<!DOCTYPE html>
<!-- saved from url=(0080)https://juejin.im/book/5bdc715fe51d454e755f75ef/section/5bdc715f6fb9a049c15ea4e0 -->
<html lang="zh-CN"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no,viewport-fit=cover"><meta name="google-site-verification" content="cCHsgG9ktuCTgWgYfqCJql8AeR4gAne4DTZqztPoirE"><meta name="apple-itunes-app" content="app-id=987739104"><meta name="baidu-site-verification" content="qiK2a1kcFc"><meta name="360-site-verification" content="4c3c7d57d59f0e1a308462fbc7fd7e51"><meta name="sogou_site_verification" content="c49WUDZczQ"><style>body {
        font-size: 16px;
        line-height: 2;
      }
      a, button, input {
        margin: 1rem 1.5rem;
      }
      img {
        width: 0;
        height: 0;
      }
      #juejin {
        overflow-x: hidden;
      }</style><title data-vue-meta="true">前端面试之道 - yck - 掘金小册</title><link rel="apple-touch-icon" sizes="180x180" href="https://b-gold-cdn.xitu.io/favicons/v2/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="https://b-gold-cdn.xitu.io/favicons/v2/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="https://b-gold-cdn.xitu.io/favicons/v2/favicon-16x16.png"><link rel="manifest" href="https://b-gold-cdn.xitu.io/favicons/v2/manifest.json"><link rel="mask-icon" href="https://b-gold-cdn.xitu.io/favicons/v2/safari-pinned-tab.svg" color="#5bbad5"><link rel="shortcut icon" href="https://b-gold-cdn.xitu.io/favicons/v2/favicon.ico"><meta name="msapplication-config" content="https://b-gold-cdn.xitu.io/favicons/v2/browserconfig.xml"><meta name="theme-color" content="#ffffff"><link rel="search" title="掘金" href="https://b-gold-cdn.xitu.io/conf/search.xml" type="application/opensearchdescription+xml"><link rel="stylesheet" href="./2.JS 基础知识点及常考面试题（一）_files/ionicons.min.css"><link rel="stylesheet" href="./2.JS 基础知识点及常考面试题（一）_files/iconfont.css"><link href="./2.JS 基础知识点及常考面试题（一）_files/0.f53dd8c7dec37187a1f0.css" rel="stylesheet"><script async="" src="./2.JS 基础知识点及常考面试题（一）_files/hm.js"></script><script async="" src="./2.JS 基础知识点及常考面试题（一）_files/analytics.js"></script><script type="text/javascript" async="" src="./2.JS 基础知识点及常考面试题（一）_files/vds.js"></script><script charset="utf-8" src="./2.JS 基础知识点及常考面试题（一）_files/13.be327205e46595a11182.js"></script><meta data-vmid="keywords" name="keywords" content="掘金,稀土,Vue.js,微信小程序,Kotlin,RxJava,React Native,Wireshark,敏捷开发,Bootstrap,OKHttp,正则表达式,WebGL,Webpack,Docker,MVVM" data-vue-meta="true"><meta data-vmid="description" name="description" content="掘金是一个帮助开发者成长的社区，是给开发者用的 Hacker News，给设计师用的 Designer News，和给产品经理用的 Medium。掘金的技术文章由稀土上聚集的技术大牛和极客共同编辑为你筛选出最优质的干货，其中包括：Android、iOS、前端、后端等方面的内容。用户每天都可以在这里找到技术世界的头条内容。与此同时，掘金内还有沸点、掘金翻译计划、线下活动、专栏文章等内容。即使你是 GitHub、StackOverflow、开源中国的用户，我们相信你也可以在这里有所收获。" data-vue-meta="true"></head><body><div id="juejin" data-v-c5c2a81e=""><div class="global-component-box" data-v-c5c2a81e=""><!----><div data-v-c8da6528="" data-v-c5c2a81e="" class="alert-list alert-list"></div><!----><!----><!----><div class="emoji-barrage" data-v-beb06b1a="" data-v-c5c2a81e=""><!----></div><div class="book-new-user-award-popup" style="display:none;" data-v-40eb6fce="" data-v-c5c2a81e=""><div class="content-box" style="display:;" data-v-40eb6fce=""><div class="close ion-close-round" data-v-40eb6fce=""></div><div class="header" data-v-40eb6fce=""><div class="icon" data-v-40eb6fce=""><img src="./2.JS 基础知识点及常考面试题（一）_files/icon.a87e5ae.svg" data-v-40eb6fce=""></div><div class="txt" data-v-40eb6fce="">新人专享好礼</div></div><div class="desc" data-v-40eb6fce="">凡未购买过小册的用户，均可领取三张 5 折新人专享券，购买小册时自动使用专享券，最高可节省 45 元。</div><div class="tickets" data-v-40eb6fce=""><div class="ticket" data-v-40eb6fce=""><div class="ticket__inner" data-v-40eb6fce=""><div class="enjoy" data-v-40eb6fce=""><span class="new-title" data-v-40eb6fce="">小册新人 5 折券</span></div><div class="sale" data-v-40eb6fce="">最高可省 15 元</div></div></div><div class="ticket" data-v-40eb6fce=""><div class="ticket__inner" data-v-40eb6fce=""><div class="enjoy" data-v-40eb6fce=""><span class="new-title" data-v-40eb6fce="">小册新人 5 折券</span></div><div class="sale" data-v-40eb6fce="">最高可省 15 元</div></div></div><div class="ticket" data-v-40eb6fce=""><div class="ticket__inner" data-v-40eb6fce=""><div class="enjoy" data-v-40eb6fce=""><span class="new-title" data-v-40eb6fce="">小册新人 5 折券</span></div><div class="sale" data-v-40eb6fce="">最高可省 15 元</div></div></div></div><div class="remark" data-v-40eb6fce="">注：专享券的使用期限在领券的七天内。</div><div class="submit-btn" data-v-40eb6fce="">一键领取</div></div><div class="model success" style="display:none;" data-v-40eb6fce=""><div class="heading" data-v-40eb6fce="">领取成功</div><div class="content-text" data-v-40eb6fce="">购买小册时自动使用专享券</div><div class="btn-success-footer" data-v-40eb6fce=""><div class="btn-ok" data-v-40eb6fce="">知道了</div><div class="btn-ok btn-link" data-v-40eb6fce="">前往小册首页</div></div></div><div class="model fail" style="display:none;" data-v-40eb6fce=""><div class="heading" data-v-40eb6fce="">领取失败</div><div class="content-text" data-v-40eb6fce="">本活动仅适用于小册新用户</div><div class="btn-ok" data-v-40eb6fce="">知道了</div></div></div><!----></div><!----><div data-v-25b273c2="" data-v-c5c2a81e="" class="book-read-view"><section data-v-25b273c2="" class="book-section"><div data-v-25b273c2="" class="book-summary"><div data-v-25b273c2="" class="book-summary-masker"></div><div data-v-25b273c2="" class="book-summary-inner"><div data-v-25b273c2="" class="book-summary__header"><a data-v-25b273c2="" href="https://juejin.im/books" target="" rel="" class="logo"><img data-v-25b273c2="" src="./2.JS 基础知识点及常考面试题（一）_files/logo.a7995ad.svg"></a><div data-v-25b273c2="" class="label">小册</div><!----></div><!----><div data-v-d0eb2184="" data-v-25b273c2="" class="book-directory book-directory bought"><a data-v-d0eb2184="" class="section section-link read"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">1</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">小册食用指南</div><!----><!----></div><!----></a><a data-v-d0eb2184="" class="section route-active section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">2</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">JS 基础知识点及常考面试题（一）</div><!----><!----></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">3</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">JS 基础知识点及常考面试题（二）</div><!----><!----></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">4</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">ES6 知识点及常考面试题</div><!----><!----></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">5</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">JS 异步编程及常考面试题</div><!----><!----></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">6</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">手写 Promise</div><!----><!----></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">7</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">Event Loop</div><!----><!----></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">8</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">JS 进阶知识点及常考面试题</div><!----><!----></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">9</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">JS 思考题</div><!----><!----></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">10</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">DevTools Tips</div><!----><!----></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">11</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">浏览器基础知识点及常考面试题</div><!----><!----></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">12</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">浏览器缓存机制</div><!----><!----></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">13</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">浏览器渲染原理</div><!----><!----></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">14</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">安全防范知识点</div><!----><!----></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">15</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">从 V8 中看 JS 性能优化</div><!----><!----></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">16</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">性能优化琐碎事</div><!----><!----></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">17</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">Webpack 性能优化</div><!----><!----></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">18</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">实现小型打包工具</div><!----><!----></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">19</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">React 和 Vue 两大框架之间的相爱相杀</div><!----><!----></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">20</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">Vue 常考基础知识点</div><!----><!----></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">21</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">Vue 常考进阶知识点</div><!----><!----></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">22</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">React 常用知识点</div><!----><div data-v-d0eb2184="" class="sub-line"><div data-v-d0eb2184="" class="writing">写作中...</div></div></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">23</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">React 进阶</div><!----><div data-v-d0eb2184="" class="sub-line"><div data-v-d0eb2184="" class="writing">写作中...</div></div></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">24</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">监控</div><!----><div data-v-d0eb2184="" class="sub-line"><div data-v-d0eb2184="" class="writing">写作中...</div></div></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">25</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">TCP / UDP</div><!----><div data-v-d0eb2184="" class="sub-line"><div data-v-d0eb2184="" class="writing">写作中...</div></div></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">26</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">HTTP 及 TLS</div><!----><div data-v-d0eb2184="" class="sub-line"><div data-v-d0eb2184="" class="writing">写作中...</div></div></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">27</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">HTTP 2.0</div><!----><div data-v-d0eb2184="" class="sub-line"><div data-v-d0eb2184="" class="writing">写作中...</div></div></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">28</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">输入 URL 到页面渲染的整个流程</div><!----><div data-v-d0eb2184="" class="sub-line"><div data-v-d0eb2184="" class="writing">写作中...</div></div></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">29</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">设计模式</div><!----><div data-v-d0eb2184="" class="sub-line"><div data-v-d0eb2184="" class="writing">写作中...</div></div></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">30</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">常见数据结构</div><!----><div data-v-d0eb2184="" class="sub-line"><div data-v-d0eb2184="" class="writing">写作中...</div></div></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">31</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">常考算法题解析</div><!----><div data-v-d0eb2184="" class="sub-line"><div data-v-d0eb2184="" class="writing">写作中...</div></div></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">32</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">CSS 常考面试题解析</div><!----><div data-v-d0eb2184="" class="sub-line"><div data-v-d0eb2184="" class="writing">写作中...</div></div></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">33</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">如何写好一封简历</div><!----><!----></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">34</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">面试常用技巧</div><!----><!----></div><!----></a><a data-v-d0eb2184="" class="section section-link"><div data-v-d0eb2184="" class="step"><div data-v-d0eb2184="" class="step-btn">35</div></div><div data-v-d0eb2184="" class="center"><div data-v-d0eb2184="" class="title">前方的路，让我们结伴同行</div><!----><!----></div><!----></a></div><div data-v-25b273c2="" class="book-summary__footer"><div data-v-25b273c2="" class="qr-icon"><img data-v-25b273c2="" src="./2.JS 基础知识点及常考面试题（一）_files/qr-icon.881015a.svg"></div><div data-v-25b273c2="" class="qr-tips"><span data-v-25b273c2="" class="ion-close"></span><div data-v-25b273c2="" class="title"><span data-v-25b273c2="">关注公众号</span><span data-v-25b273c2="">领取优惠码</span></div><div data-v-25b273c2="" class="qr-img"><img data-v-25b273c2="" src="./2.JS 基础知识点及常考面试题（一）_files/wx-qr.13d8b4d.png"></div></div></div></div></div><div data-v-25b273c2="" class="book-content"><div data-v-25b273c2="" class="book-content-inner"><div data-v-25b273c2="" class="book-content__header visible"><div data-v-25b273c2="" class="switch"><img data-v-25b273c2="" src="./2.JS 基础知识点及常考面试题（一）_files/icon.3e69d5a.svg"></div><div data-v-25b273c2="" class="menu"><img data-v-25b273c2="" src="./2.JS 基础知识点及常考面试题（一）_files/menu.74b9add.svg"></div><div data-v-25b273c2="" class="title"><a data-v-25b273c2="" href="https://juejin.im/book/5bdc715fe51d454e755f75ef" target="" rel="">前端面试之道</a></div><div data-v-e1714a36="" data-v-25b273c2="" class="user-auth user-auth"><div data-v-e1714a36="" class="nav-item menu"><div data-v-57c47624="" data-v-cf310dfc="" data-v-e1714a36="" data-src="https://avatars0.githubusercontent.com/u/33979626?v=4" class="lazy avatar avatar loaded" style="background-image: url(&quot;https://avatars0.githubusercontent.com/u/33979626?v=4&quot;);"></div><div data-v-e1714a36="" class="nav-menu user-dropdown-list" style="display: none;"><ul data-v-e1714a36="" class="nav-menu-item-group"><li data-v-e1714a36="" class="nav-menu-item"><a data-v-e1714a36=""><i data-v-e1714a36="" class="fengwei fw-write"></i><span data-v-e1714a36="">写文章</span></a></li><!----><li data-v-e1714a36="" class="nav-menu-item"><a data-v-e1714a36=""><i data-v-e1714a36="" class="fengwei fw-draft"></i><span data-v-e1714a36="">草稿</span></a></li></ul><ul data-v-e1714a36="" class="nav-menu-item-group"><li data-v-e1714a36="" class="nav-menu-item"><a data-v-e1714a36="" href="https://juejin.im/user/5aa105a7518825555f0c8a90"><i data-v-e1714a36="" class="fengwei fw-person"></i><span data-v-e1714a36="">我的主页</span></a></li><li data-v-e1714a36="" class="nav-menu-item"><a data-v-e1714a36="" href="https://juejin.im/user/5aa105a7518825555f0c8a90/likes"><i data-v-e1714a36="" class="fengwei fw-like"></i><span data-v-e1714a36="">我喜欢的</span></a></li><!----><li data-v-e1714a36="" class="nav-menu-item"><a data-v-e1714a36="" href="https://juejin.im/user/5aa105a7518825555f0c8a90/collections"><i data-v-e1714a36="" class="fengwei fw-collection"></i><span data-v-e1714a36="">我的收藏集</span></a></li><li data-v-e1714a36="" class="nav-menu-item"><a data-v-e1714a36="" href="https://juejin.im/user/5aa105a7518825555f0c8a90/books?type=bought"><i data-v-e1714a36="" class="fengwei fw-bought"></i><span data-v-e1714a36="">已购</span></a></li><!----><li data-v-e1714a36="" class="nav-menu-item"><a data-v-e1714a36="" href="https://juejin.im/subscribe"><i data-v-e1714a36="" class="fengwei fw-tag"></i><span data-v-e1714a36="">标签管理</span></a></li></ul><ul data-v-e1714a36="" class="nav-menu-item-group"><li data-v-e1714a36="" class="nav-menu-item"><a data-v-e1714a36="" href="https://juejin.im/user/settings"><i data-v-e1714a36="" class="fengwei fw-setting"></i><span data-v-e1714a36="">设置</span></a></li><li data-v-e1714a36="" class="nav-menu-item more"><a data-v-e1714a36=""><i data-v-e1714a36="" class="fengwei fw-info"></i><span data-v-e1714a36="">关于</span><i data-v-e1714a36="" class="ion-chevron-right more-icon"></i></a><div data-v-e1714a36="" class="nav-menu more-dropdown-list"><ul data-v-e1714a36="" class="nav-menu-item-group"><li data-v-e1714a36="" class="nav-menu-item"><a data-v-e1714a36="" href="https://juejin.im/app" target="_blank">下载应用</a></li><li data-v-e1714a36="" class="nav-menu-item"><a data-v-e1714a36="" href="https://juejin.im/about" target="_blank">关于</a></li><li data-v-e1714a36="" class="nav-menu-item"><a data-v-e1714a36="" href="https://xitu.io/jobs" target="_blank">加入我们</a></li><li data-v-e1714a36="" class="nav-menu-item"><a data-v-e1714a36="" href="https://github.com/xitu/gold-miner" rel="nofollow noopener noreferrer" target="_blank">翻译计划</a></li><li data-v-e1714a36="" class="nav-menu-item"><a data-v-e1714a36="" href="https://bd.juejin.im/?utm_campaign=bd&amp;utm_source=web&amp;utm_medium=nav" target="_blank">合作伙伴</a></li></ul></div></li></ul><ul data-v-e1714a36="" class="nav-menu-item-group"><li data-v-e1714a36="" class="nav-menu-item"><a data-v-e1714a36=""><i data-v-e1714a36="" class="fengwei fw-logout"></i><span data-v-e1714a36="">登出</span></a></li></ul></div></div><!----></div><!----></div><div data-v-25b273c2="" class="book-body transition--next"><div data-v-b0f6a942="" data-v-25b273c2="" class="section-view book-section-content"><div data-v-ecce5e7e="" data-v-b0f6a942="" class="section-content"><div data-v-ecce5e7e="" class="section-page book-section-view"><div data-v-ecce5e7e="" class="entry-content article-content"><h1 class="heading" data-id="heading-0">JS 基础知识点及常考面试题（一）</h1>
<p>JS 对于每位前端开发都是必备技能，在小册中我们也会有多个章节去讲述这部分的知识。首先我们先来熟悉下 JS 的一些常考和容易混乱的基础知识点。</p>
<h2 class="heading" data-id="heading-1">原始（Primitive）类型</h2>
<blockquote class="warning"><p>涉及面试题：原始类型有哪几种？null 是对象嘛？
</p></blockquote><p>在 JS 中，存在着 6 种原始值，分别是：</p>
<ul>
<li><code>boolean</code></li>
<li><code>null</code></li>
<li><code>undefined</code></li>
<li><code>number</code></li>
<li><code>string</code></li>
<li><code>symbol</code></li>
</ul>
<p>首先原始类型存储的都是值，是没有函数可以调用的，比如 <code>undefined.toString()</code></p>
<p></p><figure><img class="lazyload inited" data-src="https://user-gold-cdn.xitu.io/2018/11/14/16711c4f991c73ac?imageView2/0/w/1280/h/960/format/webp/ignore-error/1" data-width="526" data-height="53" src="data:image/svg+xml;utf8,&lt;?xml version=&quot;1.0&quot;?&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot; width=&quot;526&quot; height=&quot;53&quot;&gt;&lt;/svg&gt;"><figcaption></figcaption></figure><p></p>
<p>此时你肯定会有疑问，这不对呀，明明 <code>'1'.toString()</code> 是可以使用的。其实在这种情况下，<code>'1'</code> 已经不是原始类型了，而是被强制转换成了 <code>String</code> 类型也就是对象类型，所以可以调用 <code>toString</code> 函数。</p>
<p>除了会在必要的情况下强转类型以外，原始类型还有一些坑。</p>
<p>其中 JS 的 <code>number</code> 类型是浮点类型的，在使用中会遇到某些 Bug，比如 <code>0.1 + 0.2 !== 0.3</code>，但是这一块的内容会在进阶部分讲到。<code>string</code> 类型是不可变的，无论你在 <code>string</code> 类型上调用何种方法，都不会对值有改变。</p>
<p>另外对于 <code>null</code> 来说，很多人会认为他是个对象类型，其实这是错误的。虽然 <code>typeof null</code> 会输出 <code>object</code>，但是这只是 JS 存在的一个悠久 Bug。在 JS 的最初版本中使用的是 32 位系统，为了性能考虑使用低位存储变量的类型信息，<code>000</code> 开头代表是对象，然而 <code>null</code> 表示为全零，所以将它错误的判断为 <code>object</code> 。虽然现在的内部类型判断代码已经改变了，但是对于这个 Bug 却是一直流传下来。</p>
<h2 class="heading" data-id="heading-2">对象（Object）类型</h2>
<blockquote class="warning"><p>涉及面试题：对象类型和原始类型的不同之处？函数参数是对象会发生什么问题？
</p></blockquote><p>在 JS 中，除了原始类型那么其他的都是对象类型了。对象类型和原始类型不同的是，原始类型存储的是值，对象类型存储的是地址（指针）。当你创建了一个对象类型的时候，计算机会在内存中帮我们开辟一个空间来存放值，但是我们需要找到这个空间，这个空间会拥有一个地址（指针）。</p>
<pre><code class="hljs js" lang="js"><span class="hljs-keyword">const</span> a = []
</code></pre><p>对于常量 <code>a</code> 来说，假设内存地址（指针）为 <code>#001</code>，那么在地址 <code>#001</code> 的位置存放了值 <code>[]</code>，常量 <code>a</code> 存放了地址（指针） <code>#001</code>，再看以下代码</p>
<pre><code class="hljs js" lang="js"><span class="hljs-keyword">const</span> a = []
<span class="hljs-keyword">const</span> b = a
b.push(<span class="hljs-number">1</span>)
</code></pre><p>当我们将变量赋值给另外一个变量时，复制的是原本变量的地址（指针），也就是说当前变量 <code>b</code> 存放的地址（指针）也是 <code>#001</code>，当我们进行数据修改的时候，就会修改存放在地址（指针） <code>#001</code> 上的值，也就导致了两个变量的值都发生了改变。</p>
<p>接下来我们来看函数参数是对象的情况</p>
<pre><code class="hljs js" lang="js"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">test</span>(<span class="hljs-params">person</span>) </span>{
  person.age = <span class="hljs-number">26</span>
  person = {
    <span class="hljs-attr">name</span>: <span class="hljs-string">'yyy'</span>,
    <span class="hljs-attr">age</span>: <span class="hljs-number">30</span>
  }

  <span class="hljs-keyword">return</span> person
}
<span class="hljs-keyword">const</span> p1 = {
  <span class="hljs-attr">name</span>: <span class="hljs-string">'yck'</span>,
  <span class="hljs-attr">age</span>: <span class="hljs-number">25</span>
}
<span class="hljs-keyword">const</span> p2 = test(p1)
<span class="hljs-built_in">console</span>.log(p1) <span class="hljs-comment">// -&gt; ?</span>
<span class="hljs-built_in">console</span>.log(p2) <span class="hljs-comment">// -&gt; ?</span>
</code></pre><p>对于以上代码，你是否能正确的写出结果呢？接下来让我为了解析一番：</p>
<ul>
<li>首先，函数传参是传递对象指针的副本</li>
<li>到函数内部修改参数的属性这步，我相信大家都知道，当前 <code>p1</code> 的值也被修改了</li>
<li>但是当我们重新为了 <code>person</code> 分配了一个对象时就出现了分歧，请看下图</li>
</ul>
<p></p><figure><img class="lazyload inited" data-src="https://user-gold-cdn.xitu.io/2018/11/14/16712ce155afef8c?imageView2/0/w/1280/h/960/format/webp/ignore-error/1" data-width="658" data-height="414" src="data:image/svg+xml;utf8,&lt;?xml version=&quot;1.0&quot;?&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot; width=&quot;658&quot; height=&quot;414&quot;&gt;&lt;/svg&gt;"><figcaption></figcaption></figure><p></p>
<p>所以最后 <code>person</code> 拥有了一个新的地址（指针），也就和 <code>p1</code> 没有任何关系了，导致了最终两个变量的值是不相同的。</p>
<h2 class="heading" data-id="heading-3">typeof vs instanceof</h2>
<blockquote class="warning"><p>涉及面试题：typeof 是否能正确判断类型？instanceof 能正确判断对象的原理是什么？
</p></blockquote><p><code>typeof</code> 对于原始类型来说，除了 <code>null</code> 都可以显示正确的类型</p>
<pre><code class="hljs js" lang="js"><span class="hljs-keyword">typeof</span> <span class="hljs-number">1</span> <span class="hljs-comment">// 'number'</span>
<span class="hljs-keyword">typeof</span> <span class="hljs-string">'1'</span> <span class="hljs-comment">// 'string'</span>
<span class="hljs-keyword">typeof</span> <span class="hljs-literal">undefined</span> <span class="hljs-comment">// 'undefined'</span>
<span class="hljs-keyword">typeof</span> <span class="hljs-literal">true</span> <span class="hljs-comment">// 'boolean'</span>
<span class="hljs-keyword">typeof</span> <span class="hljs-built_in">Symbol</span>() <span class="hljs-comment">// 'symbol'</span>
</code></pre><p><code>typeof</code> 对于对象来说，除了函数都会显示 <code>object</code>，所以说 <code>typeof</code> 并不能准确判断变量到底是什么类型</p>
<pre><code class="hljs js" lang="js"><span class="hljs-keyword">typeof</span> [] <span class="hljs-comment">// 'object'</span>
<span class="hljs-keyword">typeof</span> {} <span class="hljs-comment">// 'object'</span>
<span class="hljs-keyword">typeof</span> <span class="hljs-built_in">console</span>.log <span class="hljs-comment">// 'function'</span>
</code></pre><p>如果我们想判断一个对象的正确类型，这时候可以考虑使用 <code>instanceof</code>，因为内部机制是通过原型链来判断的，在后面的章节中我们也会自己去实现一个 <code>instanceof</code>。</p>
<pre><code class="hljs js" lang="js"><span class="hljs-keyword">const</span> Person = <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{}
<span class="hljs-keyword">const</span> p1 = <span class="hljs-keyword">new</span> Person()
p1 <span class="hljs-keyword">instanceof</span> Person <span class="hljs-comment">// true</span>

<span class="hljs-keyword">var</span> str = <span class="hljs-string">'hello world'</span>
str <span class="hljs-keyword">instanceof</span> <span class="hljs-built_in">String</span> <span class="hljs-comment">// false</span>

<span class="hljs-keyword">var</span> str1 = <span class="hljs-keyword">new</span> <span class="hljs-built_in">String</span>(<span class="hljs-string">'hello world'</span>)
str1 <span class="hljs-keyword">instanceof</span> <span class="hljs-built_in">String</span> <span class="hljs-comment">// true</span>
</code></pre><p>对于原始类型来说，你想直接通过 <code>instanceof</code> 来判断类型是不行的，当然我们还是有办法让 <code>instanceof</code> 判断原始类型的</p>
<pre><code class="hljs js" lang="js"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">PrimitiveString</span> </span>{
  <span class="hljs-keyword">static</span> [<span class="hljs-built_in">Symbol</span>.hasInstance](x) {
    <span class="hljs-keyword">return</span> <span class="hljs-keyword">typeof</span> x === <span class="hljs-string">'string'</span>
  }
}
<span class="hljs-built_in">console</span>.log(<span class="hljs-string">'hello world'</span> <span class="hljs-keyword">instanceof</span> PrimitiveString) <span class="hljs-comment">// true</span>
</code></pre><p>你可能不知道 <code>Symbol.hasInstance</code> 是什么东西，其实就是一个能让我们自定义 <code>instanceof</code> 行为的东西，以上代码等同于 <code>typeof 'hello world' === 'string'</code>，所以结果自然是 <code>true</code> 了。这其实也侧面反映了一个问题， <code>instanceof</code> 也不是百分之百可信的。</p>
<h2 class="heading" data-id="heading-4">类型转换</h2>
<blockquote class="warning"><p>涉及面试题：该知识点常在笔试题中见到，熟悉了转换规则就不惧怕此类题目了。
</p></blockquote><p>首先我们要知道，在 JS 中类型转换只有三种情况，分别是：</p>
<ul>
<li>转换为布尔值</li>
<li>转换为数字</li>
<li>转换为字符串</li>
</ul>
<p>我们先来看一个类型转换表格，然后再进入正题</p>
<p></p><figure><img class="lazyload inited" data-src="https://user-gold-cdn.xitu.io/2018/11/15/16716dec14421e47?imageView2/0/w/1280/h/960/format/webp/ignore-error/1" data-width="910" data-height="648" src="data:image/svg+xml;utf8,&lt;?xml version=&quot;1.0&quot;?&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot; width=&quot;910&quot; height=&quot;648&quot;&gt;&lt;/svg&gt;"><figcaption></figcaption></figure><p></p>
<h3 class="heading" data-id="heading-5">转Boolean</h3>
<p>在条件判断时，除了 <code>undefined</code>， <code>null</code>， <code>false</code>， <code>NaN</code>， <code>''</code>， <code>0</code>， <code>-0</code>，其他所有值都转为 <code>true</code>，包括所有对象。</p>
<h3 class="heading" data-id="heading-6">对象转原始类型</h3>
<p>对象在转换类型的时候，会调用内置的 <code>[[ToPrimitive]]</code> 函数，对于该函数来说，算法逻辑一般来说如下：</p>
<ul>
<li>如果已经是原始类型了，那就不需要转换了</li>
<li>调用 <code>x.valueOf()</code>，如果转换为基础类型，就返回转换的值</li>
<li>调用 <code>x.toString()</code>，如果转换为基础类型，就返回转换的值</li>
<li>如果都没有返回原始类型，就会报错</li>
</ul>
<p>当然你也可以重写 <code>Symbol.toPrimitive</code> ，该方法在转原始类型时调用优先级最高。</p>
<pre><code class="hljs js" lang="js"><span class="hljs-keyword">let</span> a = {
  valueOf() {
    <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>
  },
  toString() {
    <span class="hljs-keyword">return</span> <span class="hljs-string">'1'</span>
  },
  [<span class="hljs-built_in">Symbol</span>.toPrimitive]() {
    <span class="hljs-keyword">return</span> <span class="hljs-number">2</span>
  }
}
<span class="hljs-number">1</span> + a <span class="hljs-comment">// =&gt; 3</span>
</code></pre><h3 class="heading" data-id="heading-7">四则运算符</h3>
<p>加法运算符不同于其他几个运算符，它有以下几个特点：</p>
<ul>
<li>运算中其中一方为字符串，那么就会把另一方也转换为字符串</li>
<li>如果一方不是字符串或者数字，那么会将它转换为数字或者字符串</li>
</ul>
<pre><code class="hljs js" lang="js"><span class="hljs-number">1</span> + <span class="hljs-string">'1'</span> <span class="hljs-comment">// '11'</span>
<span class="hljs-literal">true</span> + <span class="hljs-literal">true</span> <span class="hljs-comment">// 2</span>
<span class="hljs-number">4</span> + [<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>] <span class="hljs-comment">// "41,2,3"</span>
</code></pre><p>如果你对于答案有疑问的话，请看解析：</p>
<ul>
<li>对于第一行代码来说，触发特点一，所以将数字 <code>1</code> 转换为字符串，得到结果 <code>'11'</code></li>
<li>对于第二行代码来说，触发特点二，所以将 <code>true</code> 转为数字 <code>1</code></li>
<li>对于第三行代码来说，触发特点二，所以将数组通过 <code>toString</code> 转为字符串 <code>1,2,3</code>，得到结果 <code>41,2,3</code></li>
</ul>
<p>另外对于加法还需要注意这个表达式 <code>'a' + + 'b'</code></p>
<pre><code class="hljs js" lang="js"><span class="hljs-string">'a'</span> + + <span class="hljs-string">'b'</span> <span class="hljs-comment">// -&gt; "aNaN"</span>
</code></pre><p>因为 <code>+ 'b'</code> 等于 <code>NaN</code>，所以结果为 <code>"aNaN"</code>，你可能也会在一些代码中看到过 <code>+ '1'</code> 的形式来快速获取 <code>number</code> 类型。</p>
<p>那么对于除了加法的运算符来说，只要其中一方是数字，那么另一方就会被转为数字</p>
<pre><code class="hljs js" lang="js"><span class="hljs-number">4</span> * <span class="hljs-string">'3'</span> <span class="hljs-comment">// 12</span>
<span class="hljs-number">4</span> * [] <span class="hljs-comment">// 0</span>
<span class="hljs-number">4</span> * [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>] <span class="hljs-comment">// NaN</span>
</code></pre><h3 class="heading" data-id="heading-8">比较运算符</h3>
<ol>
<li>如果是对象，就通过 <code>toPrimitive</code> 转换对象</li>
<li>如果是字符串，就通过 <code>unicode</code> 字符索引来比较</li>
</ol>
<pre><code class="hljs js" lang="js"><span class="hljs-keyword">let</span> a = {
  valueOf() {
    <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>
  },
  toString() {
    <span class="hljs-keyword">return</span> <span class="hljs-string">'1'</span>
  }
}
a &gt; <span class="hljs-number">-1</span> <span class="hljs-comment">// true</span>
</code></pre><p>在以上代码中，因为 <code>a</code> 是对象，所以会通过 <code>valueOf</code> 转换为原始类型再比较值。</p>
<h2 class="heading" data-id="heading-9">this</h2>
<blockquote class="warning"><p>涉及面试题：如何正确判断 this？箭头函数的 this 是什么？
</p></blockquote><p><code>this</code> 是很多人会混淆的概念，但是其实它一点都不难，只是网上很多文章把简单的东西说复杂了。在这一小节中，你一定会彻底明白 <code>this</code> 这个概念的。</p>
<p>我们先来看几个函数调用的场景</p>
<pre><code class="hljs js" lang="js"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">foo</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-built_in">console</span>.log(<span class="hljs-keyword">this</span>.a)
}
<span class="hljs-keyword">var</span> a = <span class="hljs-number">1</span>
foo()

<span class="hljs-keyword">const</span> obj = {
  <span class="hljs-attr">a</span>: <span class="hljs-number">2</span>,
  <span class="hljs-attr">foo</span>: foo
}
obj.foo()

<span class="hljs-keyword">const</span> c = <span class="hljs-keyword">new</span> foo()
</code></pre><p>接下来我们一个个分析上面几个场景</p>
<ul>
<li>对于直接调用 <code>foo</code> 来说，不管 <code>foo</code> 函数被放在了什么地方，<code>this</code> 一定是 <code>window</code></li>
<li>对于 <code>obj.foo()</code> 来说，我们只需要记住，谁调用了函数，谁就是 <code>this</code>，所以在这个场景下 <code>foo</code> 函数中的 <code>this</code> 就是 <code>obj</code> 对象</li>
<li>对于 <code>new</code> 的方式来说，<code>this</code> 被永远绑定在了 <code>c</code> 上面，不会被任何方式改变 <code>this</code></li>
</ul>
<p>说完了以上几种情况，其实很多代码中的 <code>this</code> 应该就没什么问题了，下面让我们看看箭头函数中的 <code>this</code></p>
<pre><code class="hljs js" lang="js"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">a</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">return</span> <span class="hljs-function"><span class="hljs-params">()</span> =&gt;</span> {
    <span class="hljs-keyword">return</span> <span class="hljs-function"><span class="hljs-params">()</span> =&gt;</span> {
      <span class="hljs-built_in">console</span>.log(<span class="hljs-keyword">this</span>)
    }
  }
}
<span class="hljs-built_in">console</span>.log(a()()())
</code></pre><p>首先箭头函数其实是没有 <code>this</code> 的，箭头函数中的 <code>this</code> 只取决包裹箭头函数的第一个普通函数的 <code>this</code>。在这个例子中，因为包裹箭头函数的第一个普通函数是 <code>a</code>，所以此时的 <code>this</code> 是 <code>window</code>。另外对箭头函数使用 <code>bind</code> 这类函数是无效的。</p>
<p>最后种情况也就是 <code>bind</code> 这些改变上下文的 API 了，对于这些函数来说，<code>this</code> 取决于第一个参数，如果第一个参数为空，那么就是 <code>window</code>。</p>
<p>那么说到 <code>bind</code>，不知道大家是否考虑过，如果对一个函数进行多次 <code>bind</code>，那么上下文会是什么呢？</p>
<pre><code class="hljs js" lang="js"><span class="hljs-keyword">let</span> a = {}
<span class="hljs-keyword">let</span> fn = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{ <span class="hljs-built_in">console</span>.log(<span class="hljs-keyword">this</span>) }
fn.bind().bind(a)() <span class="hljs-comment">// =&gt; ?</span>
</code></pre><p>如果你认为输出结果是 <code>a</code>，那么你就错了，其实我们可以把上述代码转换成另一种形式</p>
<pre><code class="hljs js" lang="js"><span class="hljs-comment">// fn.bind().bind(a) 等于</span>
<span class="hljs-keyword">let</span> fn2 = <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">fn1</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">return</span> <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">return</span> fn.apply()
  }.apply(a)
}
fn2()
</code></pre><p>可以从上述代码中发现，不管我们给函数 <code>bind</code> 几次，<code>fn</code> 中的 <code>this</code> 永远由第一次 <code>bind</code> 决定，所以结果永远是 <code>window</code>。</p>
<pre><code class="hljs js" lang="js"><span class="hljs-keyword">let</span> a = { <span class="hljs-attr">name</span>: <span class="hljs-string">'yck'</span> }
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">foo</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-built_in">console</span>.log(<span class="hljs-keyword">this</span>.name)
}
foo.bind(a)() <span class="hljs-comment">// =&gt; 'yck'</span>
</code></pre><p>以上就是 <code>this</code> 的规则了，但是可能会发生多个规则同时出现的情况，这时候不同的规则之间会根据优先级最高的来决定 <code>this</code> 最终指向哪里。</p>
<p>首先，<code>new</code> 的方式优先级最高，接下来是 <code>bind</code> 这些函数，然后是 <code>obj.foo()</code> 这种调用方式，最后是 <code>foo</code> 这种调用方式，同时，箭头函数的 <code>this</code> 一旦被绑定，就不会再被任何方式所改变。</p>
<p>如果你还是觉得有点绕，那么就看以下的这张流程图吧，图中的流程只针对于单个规则。</p>
<p></p><figure><img class="lazyload inited" data-src="https://user-gold-cdn.xitu.io/2018/11/15/16717eaf3383aae8?imageView2/0/w/1280/h/960/format/webp/ignore-error/1" data-width="744" data-height="531" src="data:image/svg+xml;utf8,&lt;?xml version=&quot;1.0&quot;?&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot; width=&quot;744&quot; height=&quot;531&quot;&gt;&lt;/svg&gt;"><figcaption></figcaption></figure><p></p>
<h2 class="heading" data-id="heading-10">小结</h2>
<p>以上就是我们 JS 基础知识点的第一部分内容了。这一小节中涉及到的知识点在我们日常的开发中经常可以看到，并且很多容易出现的坑 也出自于这些知识点，相信认真读完的你一定会在日后的开发中少踩很多坑。如果大家对于这个章节的内容存在疑问，欢迎在评论区与我互动。</p>
</div><section data-v-ecce5e7e="" class="book-comments"><div data-v-ecce5e7e="" class="box-title">留言</div><div data-v-ecce5e7e="" class="comment-box"><div data-v-1146c0e6="" data-v-ecce5e7e="" class="comment-form comment-form" id="comment"><div data-v-57c47624="" data-v-cf310dfc="" data-v-1146c0e6="" data-src="https://avatars0.githubusercontent.com/u/33979626?v=4" class="lazy avatar avatar loaded" style="background-image: url(&quot;https://avatars0.githubusercontent.com/u/33979626?v=4&quot;);"></div><textarea data-v-1146c0e6="" placeholder="评论将在后台进行审核，审核通过后对所有人可见" class="content-input" style="overflow: hidden; overflow-wrap: break-word; height: 60px;"></textarea><div data-v-1146c0e6="" class="action-box" style="display: none;"><div data-v-627e3889="" data-v-1146c0e6="" class="image-uploader image-uploader" style="display: none;"><input data-v-627e3889="" type="file" class="input"><button data-v-627e3889="" class="upload-btn"><i data-v-627e3889="" class="icon ion-image"></i><span data-v-627e3889="">上传图片</span></button></div><div data-v-1146c0e6="" class="submit-box"><span data-v-1146c0e6="" class="submit-text">Ctrl or ⌘ + Enter</span><button data-v-1146c0e6="" class="submit-btn">评论</button></div></div><!----></div></div><ul data-v-6adae277="" data-v-ecce5e7e="" st:block="commentList" class="comment-list comment-list"><li data-v-6adae277="" class="item"><div data-v-38783431="" data-v-6adae277="" class="comment"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5712832f128fe1006cee5f3c" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5712832f128fe1006cee5f3c" target="_blank" rel="" data-v-3a6943ce=""><div data-v-57c47624="" data-v-cf310dfc="" data-v-38783431="" data-src="https://user-gold-cdn.xitu.io/2017/8/25/e6bc0347fe0ec61cb2362ddcb665bd60?imageView2/1/w/100/h/100/q/85/format/webp/interlace/1" class="lazy avatar avatar" style="background-image: none;"></div></a></div><div data-v-38783431="" class="content-box"><div data-v-38783431="" class="header"><div data-v-38783431="" class="user-info"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5712832f128fe1006cee5f3c" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5712832f128fe1006cee5f3c" target="_blank" rel="" class="username" data-v-3a6943ce="">永孩儿</a></div><div data-v-38783431="" class="position"></div></div></div><div data-v-38783431="" class="content"><!----><span data-v-38783431="" class="content-html">感受到了满满的干货，同时说明我基础薄弱，赞</span><!----></div><div data-v-38783431="" class="footer"><button data-v-38783431="" class="like-btn"><i data-v-38783431="" class="collection-arrow-ion ion-arrow-up-b"></i><span data-v-38783431="">0</span></button><span data-v-38783431="" class="sub-comment-btn text-pointer"><span data-v-38783431="" class="title">评论</span><div data-v-38783431="" class="sub-comment--arrow" style="display: none;"></div></span><span data-v-38783431="" class="date">1小时前</span><!----></div><!----></div><!----></div></li><li data-v-6adae277="" class="item"><div data-v-38783431="" data-v-6adae277="" class="comment"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5adf202af265da0b84551306" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5adf202af265da0b84551306" target="_blank" rel="" data-v-3a6943ce=""><div data-v-57c47624="" data-v-cf310dfc="" data-v-38783431="" data-src="https://user-gold-cdn.xitu.io/2019/1/8/1682cdf36e80f675?imageView2/1/w/100/h/100/q/85/format/webp/interlace/1" class="lazy avatar avatar loaded" style="background-image: url(&quot;https://user-gold-cdn.xitu.io/2019/1/8/1682cdf36e80f675?imageView2/1/w/100/h/100/q/85/format/webp/interlace/1&quot;);"></div></a></div><div data-v-38783431="" class="content-box"><div data-v-38783431="" class="header"><div data-v-38783431="" class="user-info"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5adf202af265da0b84551306" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5adf202af265da0b84551306" target="_blank" rel="" class="username" data-v-3a6943ce="">wq93</a></div><div data-v-38783431="" class="position">前端工程师</div></div></div><div data-v-38783431="" class="content"><!----><span data-v-38783431="" class="content-html">四则运算符
加法运算符不同于其他几个运算符，它有以下几个特点：

运算中其中一方为字符串，那么就会把另一方也转换为字符串
如果一方不是字符串或者数字，那么会将它转换为数字或者字符串

"如果一方不是字符串或者数字，那么会将它转换为数字或者字符串
" 感觉这个总结的有问题,如果是引用类型的话应该是调用toPrimitive规则</span><!----></div><div data-v-38783431="" class="footer"><button data-v-38783431="" class="like-btn"><i data-v-38783431="" class="collection-arrow-ion ion-arrow-up-b"></i><span data-v-38783431="">0</span></button><span data-v-38783431="" class="sub-comment-btn text-pointer"><span data-v-38783431="" class="title">评论</span><div data-v-38783431="" class="sub-comment--arrow" style="display: none;"></div></span><span data-v-38783431="" class="date">23小时前</span><!----></div><!----></div><!----></div></li><li data-v-6adae277="" class="item"><div data-v-38783431="" data-v-6adae277="" class="comment"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5b1108286fb9a01e3e5cdd62" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5b1108286fb9a01e3e5cdd62" target="_blank" rel="" data-v-3a6943ce=""><div data-v-57c47624="" data-v-cf310dfc="" data-v-38783431="" data-src="https://user-gold-cdn.xitu.io/2019/1/3/16811f6575375832?imageView2/1/w/100/h/100/q/85/format/webp/interlace/1" class="lazy avatar avatar" style="background-image: none;"></div></a></div><div data-v-38783431="" class="content-box"><div data-v-38783431="" class="header"><div data-v-38783431="" class="user-info"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5b1108286fb9a01e3e5cdd62" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5b1108286fb9a01e3e5cdd62" target="_blank" rel="" class="username" data-v-3a6943ce="">被清晨的馬路寵愛著</a></div><div data-v-38783431="" class="position">前端实习生 @ 上海中期期货股份有限公司</div></div></div><div data-v-38783431="" class="content"><!----><span data-v-38783431="" class="content-html">正在看</span><!----></div><div data-v-38783431="" class="footer"><button data-v-38783431="" class="like-btn"><i data-v-38783431="" class="collection-arrow-ion ion-arrow-up-b"></i><span data-v-38783431="">0</span></button><span data-v-38783431="" class="sub-comment-btn text-pointer"><span data-v-38783431="" class="title">评论</span><div data-v-38783431="" class="sub-comment--arrow" style="display: none;"></div></span><span data-v-38783431="" class="date">2天前</span><!----></div><!----></div><!----></div></li><li data-v-6adae277="" class="item"><div data-v-38783431="" data-v-6adae277="" class="comment"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5bc3d8206fb9a05ce37b1fae" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5bc3d8206fb9a05ce37b1fae" target="_blank" rel="" data-v-3a6943ce=""><div data-v-57c47624="" data-v-cf310dfc="" data-v-38783431="" data-src="https://user-gold-cdn.xitu.io/2018/10/15/1667564f88eb5d2d?imageView2/1/w/100/h/100/q/85/format/webp/interlace/1" class="lazy avatar avatar" style="background-image: none;"></div></a></div><div data-v-38783431="" class="content-box"><div data-v-38783431="" class="header"><div data-v-38783431="" class="user-info"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5bc3d8206fb9a05ce37b1fae" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5bc3d8206fb9a05ce37b1fae" target="_blank" rel="" class="username" data-v-3a6943ce="">枯木朽株</a></div><div data-v-38783431="" class="position">web前端 @ 杭州诚淘电商</div></div></div><div data-v-38783431="" class="content"><!----><span data-v-38783431="" class="content-html">第一次比较全面的了解了this的指向问题</span><!----></div><div data-v-38783431="" class="footer"><button data-v-38783431="" class="like-btn"><i data-v-38783431="" class="collection-arrow-ion ion-arrow-up-b"></i><span data-v-38783431="">0</span></button><span data-v-38783431="" class="sub-comment-btn text-pointer"><span data-v-38783431="" class="title">评论</span><div data-v-38783431="" class="sub-comment--arrow" style="display: none;"></div></span><span data-v-38783431="" class="date">3天前</span><!----></div><!----></div><!----></div></li><li data-v-6adae277="" class="item"><div data-v-38783431="" data-v-6adae277="" class="comment"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5800c5b267f3560058a9f89f" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5800c5b267f3560058a9f89f" target="_blank" rel="" data-v-3a6943ce=""><div data-v-57c47624="" data-v-cf310dfc="" data-v-38783431="" data-src="https://user-gold-cdn.xitu.io/2018/10/30/166c3cdb0ebfd2b9?imageView2/1/w/100/h/100/q/85/format/webp/interlace/1" class="lazy avatar avatar" style="background-image: none;"></div></a></div><div data-v-38783431="" class="content-box"><div data-v-38783431="" class="header"><div data-v-38783431="" class="user-info"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5800c5b267f3560058a9f89f" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5800c5b267f3560058a9f89f" target="_blank" rel="" class="username" data-v-3a6943ce="">AddOneG</a></div><div data-v-38783431="" class="position">前端 @ 小学二年级</div></div></div><div data-v-38783431="" class="content"><!----><span data-v-38783431="" class="content-html">讲的一般</span><!----></div><div data-v-38783431="" class="footer"><button data-v-38783431="" class="like-btn"><i data-v-38783431="" class="collection-arrow-ion ion-arrow-up-b"></i><span data-v-38783431="">4</span></button><span data-v-38783431="" class="sub-comment-btn text-pointer"><span data-v-38783431="" class="title">评论</span><div data-v-38783431="" class="sub-comment--arrow" style="display: none;"></div></span><span data-v-38783431="" class="date">4天前</span><!----></div><!----></div><!----></div></li><li data-v-6adae277="" class="item"><div data-v-38783431="" data-v-6adae277="" class="comment"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="592ff0572f301e006bcc313f" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/592ff0572f301e006bcc313f" target="_blank" rel="" data-v-3a6943ce=""><div data-v-57c47624="" data-v-cf310dfc="" data-v-38783431="" data-src="https://avatars2.githubusercontent.com/u/22095365?v=3" class="lazy avatar avatar" style="background-image: none;"></div></a></div><div data-v-38783431="" class="content-box"><div data-v-38783431="" class="header"><div data-v-38783431="" class="user-info"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="592ff0572f301e006bcc313f" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/592ff0572f301e006bcc313f" target="_blank" rel="" class="username" data-v-3a6943ce="">jinlong</a></div><div data-v-38783431="" class="position"></div></div></div><div data-v-38783431="" class="content"><!----><span data-v-38783431="" class="content-html">这个this图牛逼了</span><!----></div><div data-v-38783431="" class="footer"><button data-v-38783431="" class="like-btn"><i data-v-38783431="" class="collection-arrow-ion ion-arrow-up-b"></i><span data-v-38783431="">1</span></button><span data-v-38783431="" class="sub-comment-btn text-pointer"><span data-v-38783431="" class="title">评论</span><div data-v-38783431="" class="sub-comment--arrow" style="display: none;"></div></span><span data-v-38783431="" class="date">4天前</span><!----></div><!----></div><!----></div></li><li data-v-6adae277="" class="item"><div data-v-38783431="" data-v-6adae277="" class="comment"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="58edc26561ff4b00581ab586" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/58edc26561ff4b00581ab586" target="_blank" rel="" data-v-3a6943ce=""><div data-v-57c47624="" data-v-cf310dfc="" data-v-38783431="" data-src="https://user-gold-cdn.xitu.io/2017/4/12/cc1a127e610ffd20ffa8afd7189cacd5.jpg?imageView2/1/w/100/h/100/q/85/format/webp/interlace/1" class="lazy avatar avatar" style="background-image: none;"></div></a></div><div data-v-38783431="" class="content-box"><div data-v-38783431="" class="header"><div data-v-38783431="" class="user-info"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="58edc26561ff4b00581ab586" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/58edc26561ff4b00581ab586" target="_blank" rel="" class="username" data-v-3a6943ce="">sugusGeek</a></div><div data-v-38783431="" class="position">web前端开发 @ 指点教育</div></div></div><div data-v-38783431="" class="content"><!----><span data-v-38783431="" class="content-html">1.四则运算符的减法没有讲到哦，个加法还是不一样的，却更趋向于乘除法！2.隐式类型转换要是加入算式运算符和逻辑运算符后的混合运算，可以讲下哈！3.new Number 和 number , new String和string这种原始类型和对象类型的比较，哪些地方会用到，差异又在哪里！</span><!----></div><div data-v-38783431="" class="footer"><button data-v-38783431="" class="like-btn"><i data-v-38783431="" class="collection-arrow-ion ion-arrow-up-b"></i><span data-v-38783431="">0</span></button><span data-v-38783431="" class="sub-comment-btn text-pointer"><span data-v-38783431="" class="title">评论</span><div data-v-38783431="" class="sub-comment--arrow" style="display: none;"></div></span><span data-v-38783431="" class="date">4天前</span><!----></div><!----></div><!----></div></li><li data-v-6adae277="" class="item"><div data-v-38783431="" data-v-6adae277="" class="comment"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5bd02abb5188252f4f600569" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5bd02abb5188252f4f600569" target="_blank" rel="" data-v-3a6943ce=""><div data-v-57c47624="" data-v-cf310dfc="" data-v-38783431="" data-src="https://user-gold-cdn.xitu.io/2019/1/6/1681f1b8532d42c6?imageView2/1/w/100/h/100/q/85/format/webp/interlace/1" class="lazy avatar avatar" style="background-image: none;"></div></a></div><div data-v-38783431="" class="content-box"><div data-v-38783431="" class="header"><div data-v-38783431="" class="user-info"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5bd02abb5188252f4f600569" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5bd02abb5188252f4f600569" target="_blank" rel="" class="username" data-v-3a6943ce="">wscfan</a></div><div data-v-38783431="" class="position">前端工程师</div></div></div><div data-v-38783431="" class="content"><!----><span data-v-38783431="" class="content-html">跟着大佬走，没错。</span><!----></div><div data-v-38783431="" class="footer"><button data-v-38783431="" class="like-btn"><i data-v-38783431="" class="collection-arrow-ion ion-arrow-up-b"></i><span data-v-38783431="">0</span></button><span data-v-38783431="" class="sub-comment-btn text-pointer"><span data-v-38783431="" class="title">评论</span><div data-v-38783431="" class="sub-comment--arrow" style="display: none;"></div></span><span data-v-38783431="" class="date">5天前</span><!----></div><!----></div><!----></div></li><li data-v-6adae277="" class="item"><div data-v-38783431="" data-v-6adae277="" class="comment"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5c2342a96fb9a04a04411142" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5c2342a96fb9a04a04411142" target="_blank" rel="" data-v-3a6943ce=""><div data-v-57c47624="" data-v-cf310dfc="" data-v-38783431="" data-src="https://thirdwx.qlogo.cn/mmopen/vi_32/cgMvzeAIKqgDYt5Y6giaKFdboEgFYsylbt2iaA2MMKiazo6RmicdLnic8cIB0IjyYia5AGlXj8rea2yWa2NYqOcb3mdg/132" class="lazy avatar avatar" style="background-image: none;"></div></a></div><div data-v-38783431="" class="content-box"><div data-v-38783431="" class="header"><div data-v-38783431="" class="user-info"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5c2342a96fb9a04a04411142" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5c2342a96fb9a04a04411142" target="_blank" rel="" class="username" data-v-3a6943ce="">刘飞｜工作</a></div><div data-v-38783431="" class="position"></div></div></div><div data-v-38783431="" class="content"><!----><span data-v-38783431="" class="content-html"><a href="https://link.juejin.im/?target=https%3A%2F%2Fgithub.com%2Fmqyqingfeng%2FBlog%2Fissues%2F10" target="_blank" rel="nofollow noopener noreferrer">https://github.com/mqyqingfeng/Blog/issues/10</a></span><!----></div><div data-v-38783431="" class="footer"><button data-v-38783431="" class="like-btn"><i data-v-38783431="" class="collection-arrow-ion ion-arrow-up-b"></i><span data-v-38783431="">0</span></button><span data-v-38783431="" class="sub-comment-btn text-pointer"><span data-v-38783431="" class="title">评论</span><div data-v-38783431="" class="sub-comment--arrow" style="display: none;"></div></span><span data-v-38783431="" class="date">6天前</span><!----></div><!----></div><!----></div></li><li data-v-6adae277="" class="item"><div data-v-38783431="" data-v-6adae277="" class="comment"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5bb6114cf265da0b001f459f" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5bb6114cf265da0b001f459f" target="_blank" rel="" data-v-3a6943ce=""><div data-v-57c47624="" data-v-cf310dfc="" data-v-38783431="" data-src="https://tva2.sinaimg.cn/crop.14.0.722.722.180/9fd00fabjw8fag85y8jqqj20ku0k2dgp.jpg" class="lazy avatar avatar" style="background-image: none;"></div></a></div><div data-v-38783431="" class="content-box"><div data-v-38783431="" class="header"><div data-v-38783431="" class="user-info"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5bb6114cf265da0b001f459f" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5bb6114cf265da0b001f459f" target="_blank" rel="" class="username" data-v-3a6943ce="">希望and现实</a></div><div data-v-38783431="" class="position"></div></div></div><div data-v-38783431="" class="content"><!----><span data-v-38783431="" class="content-html">const p2 = test(p1)那边不就是返回preson嘛...没看出和指针有什么关系...还是我漏掉什么了</span><!----></div><div data-v-38783431="" class="footer"><button data-v-38783431="" class="like-btn"><i data-v-38783431="" class="collection-arrow-ion ion-arrow-up-b"></i><span data-v-38783431="">0</span></button><span data-v-38783431="" class="sub-comment-btn text-pointer"><span data-v-38783431="" class="title">收起评论</span><div data-v-38783431="" class="sub-comment--arrow" style=""></div></span><span data-v-38783431="" class="date">6天前</span><!----></div><div data-v-4afc11f9="" data-v-38783431="" class="sub-comment-box sub-comment-box"><div data-v-4afc11f9="" class="sub-comment-box__top"><div data-v-4afc11f9="" class="icon-close"></div><h3 data-v-4afc11f9="">评论</h3></div><div data-v-4afc11f9="" class="sub-comment-box__inner"><div data-v-4afc11f9=""><ul data-v-4afc11f9="" class="sub-comment-list"><li data-v-4afc11f9="" class="item"><div data-v-6fd44370="" data-v-4afc11f9="" class="sub-comment sub-comment"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5adf202af265da0b84551306" class="user-popover-box user-popover--avatar"><!----><div data-v-57c47624="" data-v-cf310dfc="" data-v-6fd44370="" data-src="https://user-gold-cdn.xitu.io/2019/1/8/1682cdf36e80f675?imageView2/1/w/100/h/100/q/85/format/webp/interlace/1" class="lazy avatar avatar loaded" data-v-3a6943ce="" style="background-image: url(&quot;https://user-gold-cdn.xitu.io/2019/1/8/1682cdf36e80f675?imageView2/1/w/100/h/100/q/85/format/webp/interlace/1&quot;);"></div></div><div data-v-6fd44370="" class="content-box"><div data-v-6fd44370="" class="header"><div data-v-6fd44370="" class="user-info"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5adf202af265da0b84551306" class="user-popover-box user-popover--info"><!----><a data-v-6fd44370="" href="https://juejin.im/user/5adf202af265da0b84551306" target="_blank" rel="" class="username" data-v-3a6943ce="">wq93</a></div><div data-v-6fd44370="" class="position">前端工程师</div></div></div><div data-v-6fd44370="" class="content"><!----><span data-v-6fd44370="" class="content-html">person = {...}重新赋值了</span><!----></div><div data-v-6fd44370="" class="footer"><span data-v-6fd44370="" class="date">6天前</span><a data-v-6fd44370="" class="reply-btn">回复</a><!----></div></div><!----></div></li><li data-v-4afc11f9="" class="item"><div data-v-6fd44370="" data-v-4afc11f9="" class="sub-comment sub-comment"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="574d2f2a2e958a00693487b0" class="user-popover-box user-popover--avatar"><!----><div data-v-57c47624="" data-v-cf310dfc="" data-v-6fd44370="" data-src="https://user-gold-cdn.xitu.io/2016/11/29/1f8696de1b039644cd832953cca8f38d?imageView2/1/w/100/h/100/q/85/format/webp/interlace/1" class="lazy avatar avatar" data-v-3a6943ce="" style="background-image: none;"></div></div><div data-v-6fd44370="" class="content-box"><div data-v-6fd44370="" class="header"><div data-v-6fd44370="" class="user-info"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="574d2f2a2e958a00693487b0" class="user-popover-box user-popover--info"><!----><a data-v-6fd44370="" href="https://juejin.im/user/574d2f2a2e958a00693487b0" target="_blank" rel="" class="username" data-v-3a6943ce="">旅梦开发团</a></div><div data-v-6fd44370="" class="position">创始人 @ 旅梦开发团</div></div></div><div data-v-6fd44370="" class="content"><!----><span data-v-6fd44370="" class="content-html">当p1传给test函数里面第一句代码就是利用了指针person和p1指向相同的地址，然后person再指向另外一个地址</span><!----></div><div data-v-6fd44370="" class="footer"><span data-v-6fd44370="" class="date">5天前</span><a data-v-6fd44370="" class="reply-btn">回复</a><!----></div></div><!----></div></li><li data-v-4afc11f9="" class="item"><div data-v-6fd44370="" data-v-4afc11f9="" class="sub-comment sub-comment"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5bb6114cf265da0b001f459f" class="user-popover-box user-popover--avatar"><!----><div data-v-57c47624="" data-v-cf310dfc="" data-v-6fd44370="" data-src="https://tva2.sinaimg.cn/crop.14.0.722.722.180/9fd00fabjw8fag85y8jqqj20ku0k2dgp.jpg" class="lazy avatar avatar" data-v-3a6943ce="" style="background-image: none;"></div></div><div data-v-6fd44370="" class="content-box"><div data-v-6fd44370="" class="header"><div data-v-6fd44370="" class="user-info"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5bb6114cf265da0b001f459f" class="user-popover-box user-popover--info"><!----><a data-v-6fd44370="" href="https://juejin.im/user/5bb6114cf265da0b001f459f" target="_blank" rel="" class="username" data-v-3a6943ce="">希望and现实</a></div><div data-v-6fd44370="" class="position"></div></div></div><div data-v-6fd44370="" class="content"><span data-v-6fd44370="" class="text-reply">回复<a data-v-6fd44370="" href="https://juejin.im/user/574d2f2a2e958a00693487b0" target="_blank" rel=""><span data-v-6fd44370="" class="username">旅梦开发团</span></a>：</span><span data-v-6fd44370="" class="content-html">我指了解过一点点c，这里的意思是function里的指针是没有固定指向的嘛？</span><!----></div><div data-v-6fd44370="" class="footer"><span data-v-6fd44370="" class="date">5天前</span><a data-v-6fd44370="" class="reply-btn">回复</a><!----></div></div><!----></div></li></ul><!----></div><form data-v-4afc11f9="" class="reply-form"><textarea data-v-4afc11f9="" rows="1" maxlength="1024" placeholder="评论审核通过后显示" style="overflow: hidden; overflow-wrap: break-word; height: 35px;"></textarea><button data-v-4afc11f9="" class="reply-btn">评论</button></form></div></div></div><!----></div></li><li data-v-6adae277="" class="item"><div data-v-38783431="" data-v-6adae277="" class="comment"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5bd044496fb9a05d1658c8ea" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5bd044496fb9a05d1658c8ea" target="_blank" rel="" data-v-3a6943ce=""><div data-v-57c47624="" data-v-cf310dfc="" data-v-38783431="" data-src="https://thirdwx.qlogo.cn/mmopen/vi_32/0RbBItibyUk6mvbfISP4TCuUZiaeuZBacWxxL35h2413H92B4AHS9BWscBdt2ibAxYgtmgFRfN3Hia65iafJK9KBnqg/132" class="lazy avatar avatar" style="background-image: none;"></div></a></div><div data-v-38783431="" class="content-box"><div data-v-38783431="" class="header"><div data-v-38783431="" class="user-info"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5bd044496fb9a05d1658c8ea" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5bd044496fb9a05d1658c8ea" target="_blank" rel="" class="username" data-v-3a6943ce="">诺诺同志</a></div><div data-v-38783431="" class="position"></div></div></div><div data-v-38783431="" class="content"><!----><span data-v-38783431="" class="content-html">确实牛批</span><!----></div><div data-v-38783431="" class="footer"><button data-v-38783431="" class="like-btn"><i data-v-38783431="" class="collection-arrow-ion ion-arrow-up-b"></i><span data-v-38783431="">0</span></button><span data-v-38783431="" class="sub-comment-btn text-pointer"><span data-v-38783431="" class="title">评论</span><div data-v-38783431="" class="sub-comment--arrow" style="display: none;"></div></span><span data-v-38783431="" class="date">7天前</span><!----></div><!----></div><!----></div></li><li data-v-6adae277="" class="item"><div data-v-38783431="" data-v-6adae277="" class="comment"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5c1ed9216fb9a04a0f652ae5" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5c1ed9216fb9a04a0f652ae5" target="_blank" rel="" data-v-3a6943ce=""><div data-v-57c47624="" data-v-cf310dfc="" data-v-38783431="" data-src="https://user-gold-cdn.xitu.io/2018/12/23/167d88131f954a9f?imageView2/1/w/100/h/100/q/85/format/webp/interlace/1" class="lazy avatar avatar" style="background-image: none;"></div></a></div><div data-v-38783431="" class="content-box"><div data-v-38783431="" class="header"><div data-v-38783431="" class="user-info"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5c1ed9216fb9a04a0f652ae5" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5c1ed9216fb9a04a0f652ae5" target="_blank" rel="" class="username" data-v-3a6943ce="">Rockj</a></div><div data-v-38783431="" class="position">前端工程师 @ 存勖科技</div></div></div><div data-v-38783431="" class="content"><!----><span data-v-38783431="" class="content-html">好流弊啊</span><!----></div><div data-v-38783431="" class="footer"><button data-v-38783431="" class="like-btn"><i data-v-38783431="" class="collection-arrow-ion ion-arrow-up-b"></i><span data-v-38783431="">0</span></button><span data-v-38783431="" class="sub-comment-btn text-pointer"><span data-v-38783431="" class="title">评论</span><div data-v-38783431="" class="sub-comment--arrow" style="display: none;"></div></span><span data-v-38783431="" class="date">8天前</span><!----></div><!----></div><!----></div></li><li data-v-6adae277="" class="item"><div data-v-38783431="" data-v-6adae277="" class="comment"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5b38b43ee51d45589d67f498" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5b38b43ee51d45589d67f498" target="_blank" rel="" data-v-3a6943ce=""><div data-v-57c47624="" data-v-cf310dfc="" data-v-38783431="" data-src="https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTK7DepRj94lyz4O9Fibria1cN9rJW8AKlQnLbL8brjLVgQWluDcCG0twricUAzichxcwz7vXgfIOib6R9g/132" class="lazy avatar avatar" style="background-image: none;"></div></a></div><div data-v-38783431="" class="content-box"><div data-v-38783431="" class="header"><div data-v-38783431="" class="user-info"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5b38b43ee51d45589d67f498" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5b38b43ee51d45589d67f498" target="_blank" rel="" class="username" data-v-3a6943ce="">lucahan在搞GIS</a></div><div data-v-38783431="" class="position">低级API工程师 @ 华南光电科技公司</div></div></div><div data-v-38783431="" class="content"><!----><span data-v-38783431="" class="content-html">为什么true+true的结果是2，而不是'truetrue'呢？</span><!----></div><div data-v-38783431="" class="footer"><button data-v-38783431="" class="like-btn"><i data-v-38783431="" class="collection-arrow-ion ion-arrow-up-b"></i><span data-v-38783431="">3</span></button><span data-v-38783431="" class="sub-comment-btn text-pointer"><span data-v-38783431="" class="title">收起评论</span><div data-v-38783431="" class="sub-comment--arrow" style=""></div></span><span data-v-38783431="" class="date">11天前</span><!----></div><div data-v-4afc11f9="" data-v-38783431="" class="sub-comment-box sub-comment-box"><div data-v-4afc11f9="" class="sub-comment-box__top"><div data-v-4afc11f9="" class="icon-close"></div><h3 data-v-4afc11f9="">评论</h3></div><div data-v-4afc11f9="" class="sub-comment-box__inner"><div data-v-4afc11f9=""><ul data-v-4afc11f9="" class="sub-comment-list"><li data-v-4afc11f9="" class="item"><div data-v-6fd44370="" data-v-4afc11f9="" class="sub-comment sub-comment"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5b0e60f6f265da08f0339162" class="user-popover-box user-popover--avatar"><!----><div data-v-57c47624="" data-v-cf310dfc="" data-v-6fd44370="" data-src="https://user-gold-cdn.xitu.io/2018/8/3/164fdd0cb5708bf0?imageView2/1/w/100/h/100/q/85/format/webp/interlace/1" class="lazy avatar avatar" data-v-3a6943ce="" style="background-image: none;"></div></div><div data-v-6fd44370="" class="content-box"><div data-v-6fd44370="" class="header"><div data-v-6fd44370="" class="user-info"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5b0e60f6f265da08f0339162" class="user-popover-box user-popover--info"><!----><a data-v-6fd44370="" href="https://juejin.im/user/5b0e60f6f265da08f0339162" target="_blank" rel="" class="username" data-v-3a6943ce="">dsying</a></div><div data-v-6fd44370="" class="position">web @ 个体</div></div></div><div data-v-6fd44370="" class="content"><!----><span data-v-6fd44370="" class="content-html">如果一方不是字符串或者数字，那么会将它转换为数字或者字符串</span><!----></div><div data-v-6fd44370="" class="footer"><span data-v-6fd44370="" class="date">11天前</span><a data-v-6fd44370="" class="reply-btn">回复</a><!----></div></div><!----></div></li><li data-v-4afc11f9="" class="item"><div data-v-6fd44370="" data-v-4afc11f9="" class="sub-comment sub-comment"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5b38b43ee51d45589d67f498" class="user-popover-box user-popover--avatar"><!----><div data-v-57c47624="" data-v-cf310dfc="" data-v-6fd44370="" data-src="https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTK7DepRj94lyz4O9Fibria1cN9rJW8AKlQnLbL8brjLVgQWluDcCG0twricUAzichxcwz7vXgfIOib6R9g/132" class="lazy avatar avatar" data-v-3a6943ce="" style="background-image: none;"></div></div><div data-v-6fd44370="" class="content-box"><div data-v-6fd44370="" class="header"><div data-v-6fd44370="" class="user-info"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5b38b43ee51d45589d67f498" class="user-popover-box user-popover--info"><!----><a data-v-6fd44370="" href="https://juejin.im/user/5b38b43ee51d45589d67f498" target="_blank" rel="" class="username" data-v-3a6943ce="">lucahan在搞GIS</a></div><div data-v-6fd44370="" class="position">低级API工程师 @ 华南光电科技公司</div></div></div><div data-v-6fd44370="" class="content"><span data-v-6fd44370="" class="text-reply">回复<a data-v-6fd44370="" href="https://juejin.im/user/5b0e60f6f265da08f0339162" target="_blank" rel=""><span data-v-6fd44370="" class="username">dsying</span></a>：</span><span data-v-6fd44370="" class="content-html">这句话我又不是没看到。我认为这句话解释不了true+true为什么等于2。true+true等于2的解释应该使用的是当boolean类型相加时，true/false会向number转换进行计算。而当boolean与非boolean进行运算时，才应该触发特点二。</span><!----></div><div data-v-6fd44370="" class="footer"><span data-v-6fd44370="" class="date">11天前</span><a data-v-6fd44370="" class="reply-btn">回复</a><!----></div></div><!----></div></li><li data-v-4afc11f9="" class="item"><div data-v-6fd44370="" data-v-4afc11f9="" class="sub-comment sub-comment"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5bbb7e966fb9a05d0d288910" class="user-popover-box user-popover--avatar"><!----><div data-v-57c47624="" data-v-cf310dfc="" data-v-6fd44370="" data-src="https://thirdwx.qlogo.cn/mmopen/vi_32/7xBejUvOATog16y0KbrGFF25ce6ALt83EvlzGMHDeW9209sMEkIO8FZBYW7lykDJagQ3MkoHCNR8tMX2EEJx3A/132" class="lazy avatar avatar" data-v-3a6943ce="" style="background-image: none;"></div></div><div data-v-6fd44370="" class="content-box"><div data-v-6fd44370="" class="header"><div data-v-6fd44370="" class="user-info"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5bbb7e966fb9a05d0d288910" class="user-popover-box user-popover--info"><!----><a data-v-6fd44370="" href="https://juejin.im/user/5bbb7e966fb9a05d0d288910" target="_blank" rel="" class="username" data-v-3a6943ce="">太微天帝</a></div><div data-v-6fd44370="" class="position">前端工程师 @ 博客地址：http://119.27.166.247</div></div></div><div data-v-6fd44370="" class="content"><!----><span data-v-6fd44370="" class="content-html">这么给你说吧，这里的布尔值其实也转换成数字了两个true就相当于两个1，1也也可以表示true，不信的话你可以这样试试Boolean（1）返回的也是true</span><!----></div><div data-v-6fd44370="" class="footer"><span data-v-6fd44370="" class="date">5天前</span><a data-v-6fd44370="" class="reply-btn">回复</a><!----></div></div><!----></div></li><li data-v-4afc11f9="" class="item"><div data-v-6fd44370="" data-v-4afc11f9="" class="sub-comment sub-comment"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5acee71e5188255cb07d7e5b" class="user-popover-box user-popover--avatar"><!----><div data-v-57c47624="" data-v-cf310dfc="" data-v-6fd44370="" data-src="https://tva3.sinaimg.cn/crop.0.0.180.180.180/9ae60707jw1e8qgp5bmzyj2050050aa8.jpg" class="lazy avatar avatar" data-v-3a6943ce="" style="background-image: none;"></div></div><div data-v-6fd44370="" class="content-box"><div data-v-6fd44370="" class="header"><div data-v-6fd44370="" class="user-info"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5acee71e5188255cb07d7e5b" class="user-popover-box user-popover--info"><!----><a data-v-6fd44370="" href="https://juejin.im/user/5acee71e5188255cb07d7e5b" target="_blank" rel="" class="username" data-v-3a6943ce="">二道思无邪</a></div><div data-v-6fd44370="" class="position">fe @ 百度</div></div></div><div data-v-6fd44370="" class="content"><!----><span data-v-6fd44370="" class="content-html">我觉得是先转原始类型的那个逻辑，先调valueOf(),返回1。
虽然true本身是原始类型，但是无法计算吧，这个我也不是很清晰</span><!----></div><div data-v-6fd44370="" class="footer"><span data-v-6fd44370="" class="date">1天前</span><a data-v-6fd44370="" class="reply-btn">回复</a><!----></div></div><!----></div></li><li data-v-4afc11f9="" class="item"><div data-v-6fd44370="" data-v-4afc11f9="" class="sub-comment sub-comment"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5acee71e5188255cb07d7e5b" class="user-popover-box user-popover--avatar"><!----><div data-v-57c47624="" data-v-cf310dfc="" data-v-6fd44370="" data-src="https://tva3.sinaimg.cn/crop.0.0.180.180.180/9ae60707jw1e8qgp5bmzyj2050050aa8.jpg" class="lazy avatar avatar" data-v-3a6943ce="" style="background-image: none;"></div></div><div data-v-6fd44370="" class="content-box"><div data-v-6fd44370="" class="header"><div data-v-6fd44370="" class="user-info"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5acee71e5188255cb07d7e5b" class="user-popover-box user-popover--info"><!----><a data-v-6fd44370="" href="https://juejin.im/user/5acee71e5188255cb07d7e5b" target="_blank" rel="" class="username" data-v-3a6943ce="">二道思无邪</a></div><div data-v-6fd44370="" class="position">fe @ 百度</div></div></div><div data-v-6fd44370="" class="content"><span data-v-6fd44370="" class="text-reply">回复<a data-v-6fd44370="" href="https://juejin.im/user/5acee71e5188255cb07d7e5b" target="_blank" rel=""><span data-v-6fd44370="" class="username">二道思无邪</span></a>：</span><span data-v-6fd44370="" class="content-html">我说的不对。。。普通类型要而且两个都不是字符串要先转数字</span><!----></div><div data-v-6fd44370="" class="footer"><span data-v-6fd44370="" class="date">1天前</span><a data-v-6fd44370="" class="reply-btn">回复</a><!----></div></div><!----></div></li></ul><!----></div><form data-v-4afc11f9="" class="reply-form"><textarea data-v-4afc11f9="" rows="1" maxlength="1024" placeholder="评论审核通过后显示" style="overflow: hidden; overflow-wrap: break-word; height: 35px;"></textarea><button data-v-4afc11f9="" class="reply-btn">评论</button></form></div></div></div><!----></div></li><li data-v-6adae277="" class="item"><div data-v-38783431="" data-v-6adae277="" class="comment"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="57700a730a2b58006a1e604b" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/57700a730a2b58006a1e604b" target="_blank" rel="" data-v-3a6943ce=""><div data-v-57c47624="" data-v-cf310dfc="" data-v-38783431="" data-src="https://user-gold-cdn.xitu.io/2018/12/29/167f61bbbcc21375?imageView2/1/w/100/h/100/q/85/format/webp/interlace/1" class="lazy avatar avatar" style="background-image: none;"></div></a></div><div data-v-38783431="" class="content-box"><div data-v-38783431="" class="header"><div data-v-38783431="" class="user-info"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="57700a730a2b58006a1e604b" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/57700a730a2b58006a1e604b" target="_blank" rel="" class="username" data-v-3a6943ce="">RedJam</a></div><div data-v-38783431="" class="position"></div></div></div><div data-v-38783431="" class="content"><!----><span data-v-38783431="" class="content-html">class是Es6中的，Es5中组合设计模式的一个语法糖</span><!----></div><div data-v-38783431="" class="footer"><button data-v-38783431="" class="like-btn"><i data-v-38783431="" class="collection-arrow-ion ion-arrow-up-b"></i><span data-v-38783431="">1</span></button><span data-v-38783431="" class="sub-comment-btn text-pointer"><span data-v-38783431="" class="title">评论</span><div data-v-38783431="" class="sub-comment--arrow" style="display: none;"></div></span><span data-v-38783431="" class="date">11天前</span><!----></div><!----></div><!----></div></li><li data-v-6adae277="" class="item"><div data-v-38783431="" data-v-6adae277="" class="comment"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="59f167e7f265da430d573cb9" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/59f167e7f265da430d573cb9" target="_blank" rel="" data-v-3a6943ce=""><div data-v-57c47624="" data-v-cf310dfc="" data-v-38783431="" data-src="https://user-gold-cdn.xitu.io/2017/10/26/2c159b7e2fc6994a8512a1423a0ebb51?imageView2/1/w/100/h/100/q/85/format/webp/interlace/1" class="lazy avatar avatar" style="background-image: none;"></div></a></div><div data-v-38783431="" class="content-box"><div data-v-38783431="" class="header"><div data-v-38783431="" class="user-info"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="59f167e7f265da430d573cb9" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/59f167e7f265da430d573cb9" target="_blank" rel="" class="username" data-v-3a6943ce="">大肉排小新</a></div><div data-v-38783431="" class="position">前端攻城狮</div></div></div><div data-v-38783431="" class="content"><!----><span data-v-38783431="" class="content-html">几个总结的特点都很到位呢</span><!----></div><div data-v-38783431="" class="footer"><button data-v-38783431="" class="like-btn"><i data-v-38783431="" class="collection-arrow-ion ion-arrow-up-b"></i><span data-v-38783431="">0</span></button><span data-v-38783431="" class="sub-comment-btn text-pointer"><span data-v-38783431="" class="title">评论</span><div data-v-38783431="" class="sub-comment--arrow" style="display: none;"></div></span><span data-v-38783431="" class="date">12天前</span><!----></div><!----></div><!----></div></li><li data-v-6adae277="" class="item"><div data-v-38783431="" data-v-6adae277="" class="comment"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5c23281a518825697324593d" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5c23281a518825697324593d" target="_blank" rel="" data-v-3a6943ce=""><div data-v-57c47624="" data-v-cf310dfc="" data-v-38783431="" data-src="https://thirdwx.qlogo.cn/mmopen/vi_32/c1X1ntUoI7ZjKZrbzWZJvrJuzIZmzdXfmtITv1dqicTGIdejoIP70f8PQC6AWD2Tf5FKox8KZYiagPJmUP8UjT3g/132" class="lazy avatar avatar" style="background-image: none;"></div></a></div><div data-v-38783431="" class="content-box"><div data-v-38783431="" class="header"><div data-v-38783431="" class="user-info"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5c23281a518825697324593d" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5c23281a518825697324593d" target="_blank" rel="" class="username" data-v-3a6943ce="">amy爱学习</a></div><div data-v-38783431="" class="position"></div></div></div><div data-v-38783431="" class="content"><!----><span data-v-38783431="" class="content-html">class PrimitiveString {
  static [Symbol.hasInstance](x) {
    return typeof x === 'string'
  }
}
不懂这段代码，谁能讲下相关知识点？</span><!----></div><div data-v-38783431="" class="footer"><button data-v-38783431="" class="like-btn"><i data-v-38783431="" class="collection-arrow-ion ion-arrow-up-b"></i><span data-v-38783431="">0</span></button><span data-v-38783431="" class="sub-comment-btn text-pointer"><span data-v-38783431="" class="title">收起评论</span><div data-v-38783431="" class="sub-comment--arrow" style=""></div></span><span data-v-38783431="" class="date">12天前</span><!----></div><div data-v-4afc11f9="" data-v-38783431="" class="sub-comment-box sub-comment-box"><div data-v-4afc11f9="" class="sub-comment-box__top"><div data-v-4afc11f9="" class="icon-close"></div><h3 data-v-4afc11f9="">评论</h3></div><div data-v-4afc11f9="" class="sub-comment-box__inner"><div data-v-4afc11f9=""><ul data-v-4afc11f9="" class="sub-comment-list"><li data-v-4afc11f9="" class="item"><div data-v-6fd44370="" data-v-4afc11f9="" class="sub-comment sub-comment"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="598cfa26f265da3e0e1065e4" class="user-popover-box user-popover--avatar"><!----><div data-v-57c47624="" data-v-cf310dfc="" data-v-6fd44370="" data-src="https://user-gold-cdn.xitu.io/2018/7/25/164cf59ef8fbe5b4?imageView2/1/w/100/h/100/q/85/format/webp/interlace/1" class="lazy avatar avatar" data-v-3a6943ce="" style="background-image: none;"></div></div><div data-v-6fd44370="" class="content-box"><div data-v-6fd44370="" class="header"><div data-v-6fd44370="" class="user-info"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="598cfa26f265da3e0e1065e4" class="user-popover-box user-popover--info"><!----><a data-v-6fd44370="" href="https://juejin.im/user/598cfa26f265da3e0e1065e4" target="_blank" rel="" class="username" data-v-3a6943ce="">李雨冰</a></div><div data-v-6fd44370="" class="position">前端 @ MYCOMPANY</div></div></div><div data-v-6fd44370="" class="content"><!----><span data-v-6fd44370="" class="content-html">这是es6的知识，定义了一个类，然后重写了类的instanceof方法</span><!----></div><div data-v-6fd44370="" class="footer"><span data-v-6fd44370="" class="date">11天前</span><a data-v-6fd44370="" class="reply-btn">回复</a><!----></div></div><!----></div></li><li data-v-4afc11f9="" class="item"><div data-v-6fd44370="" data-v-4afc11f9="" class="sub-comment sub-comment"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5b0e60f6f265da08f0339162" class="user-popover-box user-popover--avatar"><!----><div data-v-57c47624="" data-v-cf310dfc="" data-v-6fd44370="" data-src="https://user-gold-cdn.xitu.io/2018/8/3/164fdd0cb5708bf0?imageView2/1/w/100/h/100/q/85/format/webp/interlace/1" class="lazy avatar avatar" data-v-3a6943ce="" style="background-image: none;"></div></div><div data-v-6fd44370="" class="content-box"><div data-v-6fd44370="" class="header"><div data-v-6fd44370="" class="user-info"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5b0e60f6f265da08f0339162" class="user-popover-box user-popover--info"><!----><a data-v-6fd44370="" href="https://juejin.im/user/5b0e60f6f265da08f0339162" target="_blank" rel="" class="username" data-v-3a6943ce="">dsying</a></div><div data-v-6fd44370="" class="position">web @ 个体</div></div></div><div data-v-6fd44370="" class="content"><!----><span data-v-6fd44370="" class="content-html">static 标记静态属性，通过 类.属性名 的方式调用</span><!----></div><div data-v-6fd44370="" class="footer"><span data-v-6fd44370="" class="date">11天前</span><a data-v-6fd44370="" class="reply-btn">回复</a><!----></div></div><!----></div></li><li data-v-4afc11f9="" class="item"><div data-v-6fd44370="" data-v-4afc11f9="" class="sub-comment sub-comment"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="59ba13fb5188256bd733c149" class="user-popover-box user-popover--avatar"><!----><div data-v-57c47624="" data-v-cf310dfc="" data-v-6fd44370="" data-src="https://wx.qlogo.cn/mmopen/vi_32/icRMfxTtOCJWk0s4OJh1WbIicmhyJt9yiayXN0vyNGsibjvrD0DQIplOneJ92IdDKv0JicRXNTnkAlu5uOibfJhdtH8Q/0" class="lazy avatar avatar" data-v-3a6943ce="" style="background-image: none;"></div></div><div data-v-6fd44370="" class="content-box"><div data-v-6fd44370="" class="header"><div data-v-6fd44370="" class="user-info"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="59ba13fb5188256bd733c149" class="user-popover-box user-popover--info"><!----><a data-v-6fd44370="" href="https://juejin.im/user/59ba13fb5188256bd733c149" target="_blank" rel="" class="username" data-v-3a6943ce="">闹闹不爱闹</a></div><div data-v-6fd44370="" class="position"></div></div></div><div data-v-6fd44370="" class="content"><!----><span data-v-6fd44370="" class="content-html">这段代码如果拿es5，静态属性怎么表达呢</span><!----></div><div data-v-6fd44370="" class="footer"><span data-v-6fd44370="" class="date">11天前</span><a data-v-6fd44370="" class="reply-btn">回复</a><!----></div></div><!----></div></li><li data-v-4afc11f9="" class="item"><div data-v-6fd44370="" data-v-4afc11f9="" class="sub-comment sub-comment"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5b0e60f6f265da08f0339162" class="user-popover-box user-popover--avatar"><!----><div data-v-57c47624="" data-v-cf310dfc="" data-v-6fd44370="" data-src="https://user-gold-cdn.xitu.io/2018/8/3/164fdd0cb5708bf0?imageView2/1/w/100/h/100/q/85/format/webp/interlace/1" class="lazy avatar avatar" data-v-3a6943ce="" style="background-image: none;"></div></div><div data-v-6fd44370="" class="content-box"><div data-v-6fd44370="" class="header"><div data-v-6fd44370="" class="user-info"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5b0e60f6f265da08f0339162" class="user-popover-box user-popover--info"><!----><a data-v-6fd44370="" href="https://juejin.im/user/5b0e60f6f265da08f0339162" target="_blank" rel="" class="username" data-v-3a6943ce="">dsying</a></div><div data-v-6fd44370="" class="position">web @ 个体</div></div></div><div data-v-6fd44370="" class="content"><span data-v-6fd44370="" class="text-reply">回复<a data-v-6fd44370="" href="https://juejin.im/user/59ba13fb5188256bd733c149" target="_blank" rel=""><span data-v-6fd44370="" class="username">闹闹不爱闹</span></a>：</span><span data-v-6fd44370="" class="content-html">const PrimitiveString = {}
PrimitiveString[Symbol.hasInstance] = function(x) {
    return typeof x === 'string'
}</span><!----></div><div data-v-6fd44370="" class="footer"><span data-v-6fd44370="" class="date">11天前</span><a data-v-6fd44370="" class="reply-btn">回复</a><!----></div></div><!----></div></li><li data-v-4afc11f9="" class="item"><div data-v-6fd44370="" data-v-4afc11f9="" class="sub-comment sub-comment"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5c221220e51d4574572908a0" class="user-popover-box user-popover--avatar"><!----><div data-v-57c47624="" data-v-cf310dfc="" data-v-6fd44370="" data-src="https://user-gold-cdn.xitu.io/2019/1/3/168143a54229bfe9?imageView2/1/w/100/h/100/q/85/format/webp/interlace/1" class="lazy avatar avatar" data-v-3a6943ce="" style="background-image: none;"></div></div><div data-v-6fd44370="" class="content-box"><div data-v-6fd44370="" class="header"><div data-v-6fd44370="" class="user-info"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5c221220e51d4574572908a0" class="user-popover-box user-popover--info"><!----><a data-v-6fd44370="" href="https://juejin.im/user/5c221220e51d4574572908a0" target="_blank" rel="" class="username" data-v-3a6943ce="">Alian666</a></div><div data-v-6fd44370="" class="position"></div></div></div><div data-v-6fd44370="" class="content"><span data-v-6fd44370="" class="text-reply">回复<a data-v-6fd44370="" href="https://juejin.im/user/5b0e60f6f265da08f0339162" target="_blank" rel=""><span data-v-6fd44370="" class="username">dsying</span></a>：</span><span data-v-6fd44370="" class="content-html">假如较真一点，const也是es6的内容，如果用es5的方式，是不是还要做什么处理？</span><!----></div><div data-v-6fd44370="" class="footer"><span data-v-6fd44370="" class="date">6天前</span><a data-v-6fd44370="" class="reply-btn">回复</a><!----></div></div><!----></div></li></ul><ul data-v-5d3e9a75="" data-v-4afc11f9="" class="pagination pagination"><!----><li data-v-5d3e9a75="" class="item current">1</li><li data-v-5d3e9a75="" class="item">2</li><li data-v-5d3e9a75="" class="item">下一页</li></ul></div><form data-v-4afc11f9="" class="reply-form"><textarea data-v-4afc11f9="" rows="1" maxlength="1024" placeholder="评论审核通过后显示" style="overflow: hidden; overflow-wrap: break-word; height: 35px;"></textarea><button data-v-4afc11f9="" class="reply-btn">评论</button></form></div></div></div><!----></div></li><li data-v-6adae277="" class="item"><div data-v-38783431="" data-v-6adae277="" class="comment"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5ae43778f265da0b9671fbd1" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5ae43778f265da0b9671fbd1" target="_blank" rel="" data-v-3a6943ce=""><div data-v-57c47624="" data-v-cf310dfc="" data-v-38783431="" data-src="https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKU9KPia4VHDopo7C6EBxGTib9ibsQgQVNMacPzentx0j25T6t4QcuNX22bcJuaiahliaTjhJfc1P3lHPA/132" class="lazy avatar avatar" style="background-image: none;"></div></a></div><div data-v-38783431="" class="content-box"><div data-v-38783431="" class="header"><div data-v-38783431="" class="user-info"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5ae43778f265da0b9671fbd1" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5ae43778f265da0b9671fbd1" target="_blank" rel="" class="username" data-v-3a6943ce="">wxy同志</a></div><div data-v-38783431="" class="position"></div></div></div><div data-v-38783431="" class="content"><!----><span data-v-38783431="" class="content-html">看起来不错呢</span><!----></div><div data-v-38783431="" class="footer"><button data-v-38783431="" class="like-btn"><i data-v-38783431="" class="collection-arrow-ion ion-arrow-up-b"></i><span data-v-38783431="">0</span></button><span data-v-38783431="" class="sub-comment-btn text-pointer"><span data-v-38783431="" class="title">评论</span><div data-v-38783431="" class="sub-comment--arrow" style="display: none;"></div></span><span data-v-38783431="" class="date">13天前</span><!----></div><!----></div><!----></div></li><li data-v-6adae277="" class="item"><div data-v-38783431="" data-v-6adae277="" class="comment"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5b0e60f6f265da08f0339162" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5b0e60f6f265da08f0339162" target="_blank" rel="" data-v-3a6943ce=""><div data-v-57c47624="" data-v-cf310dfc="" data-v-38783431="" data-src="https://user-gold-cdn.xitu.io/2018/8/3/164fdd0cb5708bf0?imageView2/1/w/100/h/100/q/85/format/webp/interlace/1" class="lazy avatar avatar" style="background-image: none;"></div></a></div><div data-v-38783431="" class="content-box"><div data-v-38783431="" class="header"><div data-v-38783431="" class="user-info"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="5b0e60f6f265da08f0339162" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/5b0e60f6f265da08f0339162" target="_blank" rel="" class="username" data-v-3a6943ce="">dsying</a></div><div data-v-38783431="" class="position">web @ 个体</div></div></div><div data-v-38783431="" class="content"><!----><span data-v-38783431="" class="content-html">```
function foo() {
  console.log(this.a)
}
let a = 1
foo()
```
大佬 你这个例子 在这里 应该不符合你的意思， let 不会 绑定到window上 ，所以 this.a 是undefined</span><!----></div><div data-v-38783431="" class="footer"><button data-v-38783431="" class="like-btn"><i data-v-38783431="" class="collection-arrow-ion ion-arrow-up-b"></i><span data-v-38783431="">11</span></button><span data-v-38783431="" class="sub-comment-btn text-pointer"><span data-v-38783431="" class="title">收起评论</span><div data-v-38783431="" class="sub-comment--arrow" style=""></div></span><span data-v-38783431="" class="date">13天前</span><!----></div><div data-v-4afc11f9="" data-v-38783431="" class="sub-comment-box sub-comment-box"><div data-v-4afc11f9="" class="sub-comment-box__top"><div data-v-4afc11f9="" class="icon-close"></div><h3 data-v-4afc11f9="">评论</h3></div><div data-v-4afc11f9="" class="sub-comment-box__inner"><div data-v-4afc11f9=""><ul data-v-4afc11f9="" class="sub-comment-list"><li data-v-4afc11f9="" class="item"><div data-v-6fd44370="" data-v-4afc11f9="" class="sub-comment sub-comment"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5c238c36e51d45463769b2fe" class="user-popover-box user-popover--avatar"><!----><div data-v-57c47624="" data-v-cf310dfc="" data-v-6fd44370="" data-src="https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKRcnUicxyYKuk94n3JCAf1JickVaSibruZTOE8Cyo8YVcicenFPYjeDRzpaa7RslNMr7nE4cW4kud9og/132" class="lazy avatar avatar" data-v-3a6943ce="" style="background-image: none;"></div></div><div data-v-6fd44370="" class="content-box"><div data-v-6fd44370="" class="header"><div data-v-6fd44370="" class="user-info"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5c238c36e51d45463769b2fe" class="user-popover-box user-popover--info"><!----><a data-v-6fd44370="" href="https://juejin.im/user/5c238c36e51d45463769b2fe" target="_blank" rel="" class="username" data-v-3a6943ce="">958</a></div><div data-v-6fd44370="" class="position"></div></div></div><div data-v-6fd44370="" class="content"><!----><span data-v-6fd44370="" class="content-html">你的a是不是没有传参进函数</span><!----></div><div data-v-6fd44370="" class="footer"><span data-v-6fd44370="" class="date">12天前</span><a data-v-6fd44370="" class="reply-btn">回复</a><!----></div></div><!----></div></li><li data-v-4afc11f9="" class="item"><div data-v-6fd44370="" data-v-4afc11f9="" class="sub-comment sub-comment"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5b0e60f6f265da08f0339162" class="user-popover-box user-popover--avatar"><!----><div data-v-57c47624="" data-v-cf310dfc="" data-v-6fd44370="" data-src="https://user-gold-cdn.xitu.io/2018/8/3/164fdd0cb5708bf0?imageView2/1/w/100/h/100/q/85/format/webp/interlace/1" class="lazy avatar avatar" data-v-3a6943ce="" style="background-image: none;"></div></div><div data-v-6fd44370="" class="content-box"><div data-v-6fd44370="" class="header"><div data-v-6fd44370="" class="user-info"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5b0e60f6f265da08f0339162" class="user-popover-box user-popover--info"><!----><a data-v-6fd44370="" href="https://juejin.im/user/5b0e60f6f265da08f0339162" target="_blank" rel="" class="username" data-v-3a6943ce="">dsying</a></div><div data-v-6fd44370="" class="position">web @ 个体</div></div></div><div data-v-6fd44370="" class="content"><!----><span data-v-6fd44370="" class="content-html">通过this读取window上的变量a，和传参有什么关系</span><!----></div><div data-v-6fd44370="" class="footer"><span data-v-6fd44370="" class="date">11天前</span><a data-v-6fd44370="" class="reply-btn">回复</a><!----></div></div><!----></div></li><li data-v-4afc11f9="" class="item"><div data-v-6fd44370="" data-v-4afc11f9="" class="sub-comment sub-comment"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5af857126fb9a07ac90d4dd6" class="user-popover-box user-popover--avatar"><!----><div data-v-57c47624="" data-v-cf310dfc="" data-v-6fd44370="" data-src="https://thirdwx.qlogo.cn/mmopen/vi_32/y5eITvERZuuKShMjSUqib3t7DrRZib6EnovYlMGgmbHzpPbKqwyJW8Ey9neHLWvmiaWrJINNeJVDtSpsXv0pNyeJA/132" class="lazy avatar avatar" data-v-3a6943ce="" style="background-image: none;"></div></div><div data-v-6fd44370="" class="content-box"><div data-v-6fd44370="" class="header"><div data-v-6fd44370="" class="user-info"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5af857126fb9a07ac90d4dd6" class="user-popover-box user-popover--info"><!----><a data-v-6fd44370="" href="https://juejin.im/user/5af857126fb9a07ac90d4dd6" target="_blank" rel="" class="username" data-v-3a6943ce="">哎呦歪</a></div><div data-v-6fd44370="" class="position">web前端开发</div></div></div><div data-v-6fd44370="" class="content"><!----><span data-v-6fd44370="" class="content-html">let 声明的变量不会挂在window上，var声明的会</span><!----></div><div data-v-6fd44370="" class="footer"><span data-v-6fd44370="" class="date">11天前</span><a data-v-6fd44370="" class="reply-btn">回复</a><!----></div></div><!----></div></li><li data-v-4afc11f9="" class="item"><div data-v-6fd44370="" data-v-4afc11f9="" class="sub-comment sub-comment"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5be6ff3e51882516cd708de4" class="user-popover-box user-popover--avatar"><!----><div data-v-57c47624="" data-v-cf310dfc="" data-v-6fd44370="" data-src="https://avatars2.githubusercontent.com/u/38236070?v=4" class="lazy avatar avatar" data-v-3a6943ce="" style="background-image: none;"></div></div><div data-v-6fd44370="" class="content-box"><div data-v-6fd44370="" class="header"><div data-v-6fd44370="" class="user-info"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5be6ff3e51882516cd708de4" class="user-popover-box user-popover--info"><!----><a data-v-6fd44370="" href="https://juejin.im/user/5be6ff3e51882516cd708de4" target="_blank" rel="" class="username" data-v-3a6943ce="">86driver</a></div><div data-v-6fd44370="" class="position"></div></div></div><div data-v-6fd44370="" class="content"><!----><span data-v-6fd44370="" class="content-html">大佬好眼力</span><!----></div><div data-v-6fd44370="" class="footer"><span data-v-6fd44370="" class="date">10天前</span><a data-v-6fd44370="" class="reply-btn">回复</a><!----></div></div><!----></div></li><li data-v-4afc11f9="" class="item"><div data-v-6fd44370="" data-v-4afc11f9="" class="sub-comment sub-comment"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="59de0ac151882578b8184826" class="user-popover-box user-popover--avatar"><!----><div data-v-57c47624="" data-v-cf310dfc="" data-v-6fd44370="" data-src="https://avatars0.githubusercontent.com/u/20055312?v=4" class="lazy avatar avatar" data-v-3a6943ce="" style="background-image: none;"></div></div><div data-v-6fd44370="" class="content-box"><div data-v-6fd44370="" class="header"><div data-v-6fd44370="" class="user-info"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="59de0ac151882578b8184826" class="user-popover-box user-popover--info"><!----><a data-v-6fd44370="" href="https://juejin.im/user/59de0ac151882578b8184826" target="_blank" rel="" class="username" data-v-3a6943ce="">raintao</a></div><div data-v-6fd44370="" class="position">web</div></div></div><div data-v-6fd44370="" class="content"><!----><span data-v-6fd44370="" class="content-html">let 声明的变量不会挂在window上，结果应该是undefined</span><!----></div><div data-v-6fd44370="" class="footer"><span data-v-6fd44370="" class="date">6天前</span><a data-v-6fd44370="" class="reply-btn">回复</a><!----></div></div><!----></div></li></ul><ul data-v-5d3e9a75="" data-v-4afc11f9="" class="pagination pagination"><!----><li data-v-5d3e9a75="" class="item current">1</li><li data-v-5d3e9a75="" class="item">2</li><li data-v-5d3e9a75="" class="item">下一页</li></ul></div><form data-v-4afc11f9="" class="reply-form"><textarea data-v-4afc11f9="" rows="1" maxlength="1024" placeholder="评论审核通过后显示" style="overflow: hidden; overflow-wrap: break-word; height: 35px;"></textarea><button data-v-4afc11f9="" class="reply-btn">评论</button></form></div></div></div><!----></div></li><li data-v-6adae277="" class="item"><div data-v-38783431="" data-v-6adae277="" class="comment"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="58758be7128fe1006b4840e8" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/58758be7128fe1006b4840e8" target="_blank" rel="" data-v-3a6943ce=""><div data-v-57c47624="" data-v-cf310dfc="" data-v-38783431="" data-src="https://user-gold-cdn.xitu.io/2017/12/15/16055c80c2960ba3?imageView2/1/w/100/h/100/q/85/format/webp/interlace/1" class="lazy avatar avatar" style="background-image: none;"></div></a></div><div data-v-38783431="" class="content-box"><div data-v-38783431="" class="header"><div data-v-38783431="" class="user-info"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="58758be7128fe1006b4840e8" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/58758be7128fe1006b4840e8" target="_blank" rel="" class="username" data-v-3a6943ce="">徐小响</a></div><div data-v-38783431="" class="position">前端开发 @ 观脉通讯</div></div></div><div data-v-38783431="" class="content"><!----><span data-v-38783431="" class="content-html">看&lt;你不知道的JavaScript&gt;上中下，不就行了。</span><!----></div><div data-v-38783431="" class="footer"><button data-v-38783431="" class="like-btn"><i data-v-38783431="" class="collection-arrow-ion ion-arrow-up-b"></i><span data-v-38783431="">0</span></button><span data-v-38783431="" class="sub-comment-btn text-pointer"><span data-v-38783431="" class="title">收起评论</span><div data-v-38783431="" class="sub-comment--arrow" style=""></div></span><span data-v-38783431="" class="date">13天前</span><!----></div><div data-v-4afc11f9="" data-v-38783431="" class="sub-comment-box sub-comment-box"><div data-v-4afc11f9="" class="sub-comment-box__top"><div data-v-4afc11f9="" class="icon-close"></div><h3 data-v-4afc11f9="">评论</h3></div><div data-v-4afc11f9="" class="sub-comment-box__inner"><div data-v-4afc11f9=""><ul data-v-4afc11f9="" class="sub-comment-list"><li data-v-4afc11f9="" class="item"><div data-v-6fd44370="" data-v-4afc11f9="" class="sub-comment sub-comment"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5c2db9b06fb9a049dc025db2" class="user-popover-box user-popover--avatar"><!----><div data-v-57c47624="" data-v-cf310dfc="" data-v-6fd44370="" data-src="https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKWtH9kqVLWkDE9rDw9dctZicubMCnj13keunu9HfN4ImXPx2mwHfkE7M4Uwhu8Clib4vxL9zpFMocQ/132" class="lazy avatar avatar" data-v-3a6943ce="" style="background-image: none;"></div></div><div data-v-6fd44370="" class="content-box"><div data-v-6fd44370="" class="header"><div data-v-6fd44370="" class="user-info"><div data-v-3a6943ce="" data-v-6fd44370="" st:block="userPopover" st:state="5c2db9b06fb9a049dc025db2" class="user-popover-box user-popover--info"><!----><a data-v-6fd44370="" href="https://juejin.im/user/5c2db9b06fb9a049dc025db2" target="_blank" rel="" class="username" data-v-3a6943ce="">呵呵就是我</a></div><div data-v-6fd44370="" class="position"></div></div></div><div data-v-6fd44370="" class="content"><!----><span data-v-6fd44370="" class="content-html">是需要和你争辩下小册与书籍的概念益处的不同吗？？</span><!----></div><div data-v-6fd44370="" class="footer"><span data-v-6fd44370="" class="date">4天前</span><a data-v-6fd44370="" class="reply-btn">回复</a><!----></div></div><!----></div></li></ul><!----></div><form data-v-4afc11f9="" class="reply-form"><textarea data-v-4afc11f9="" rows="1" maxlength="1024" placeholder="评论审核通过后显示" style="overflow: hidden; overflow-wrap: break-word; height: 35px;"></textarea><button data-v-4afc11f9="" class="reply-btn">评论</button></form></div></div></div><!----></div></li><li data-v-6adae277="" class="item"><div data-v-38783431="" data-v-6adae277="" class="comment"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="57b000947db2a2005421b5c5" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/57b000947db2a2005421b5c5" target="_blank" rel="" data-v-3a6943ce=""><div data-v-57c47624="" data-v-cf310dfc="" data-v-38783431="" data-src="https://user-gold-cdn.xitu.io/2016/11/29/f423b7d08a277b259790198a9d61a93f?imageView2/1/w/100/h/100/q/85/format/webp/interlace/1" class="lazy avatar avatar" style="background-image: none;"></div></a></div><div data-v-38783431="" class="content-box"><div data-v-38783431="" class="header"><div data-v-38783431="" class="user-info"><div data-v-3a6943ce="" data-v-38783431="" st:block="userPopover" st:state="57b000947db2a2005421b5c5" class="user-popover-box"><!----><a data-v-38783431="" href="https://juejin.im/user/57b000947db2a2005421b5c5" target="_blank" rel="" class="username" data-v-3a6943ce="">吴楠</a></div><div data-v-38783431="" class="position"></div></div></div><div data-v-38783431="" class="content"><!----><span data-v-38783431="" class="content-html">对象类型的内存指向时候，可以顺带介绍下指针、值和堆内存、栈内存的关系</span><!----></div><div data-v-38783431="" class="footer"><button data-v-38783431="" class="like-btn"><i data-v-38783431="" class="collection-arrow-ion ion-arrow-up-b"></i><span data-v-38783431="">5</span></button><span data-v-38783431="" class="sub-comment-btn text-pointer"><span data-v-38783431="" class="title">评论</span><div data-v-38783431="" class="sub-comment--arrow" style="display: none;"></div></span><span data-v-38783431="" class="date">14天前</span><!----></div><!----></div><!----></div></li><!----></ul></section></div></div><!----><!----></div></div><div data-v-06852630="" data-v-25b273c2="" class="book-handle book-direction" style=""><div data-v-06852630="" class="step-btn step-btn--prev"><img data-v-06852630="" src="./2.JS 基础知识点及常考面试题（一）_files/prev.87ad47e.svg"></div><div data-v-06852630="" class="step-btn step-btn--next"><img data-v-06852630="" src="./2.JS 基础知识点及常考面试题（一）_files/next.54d8a35.svg"></div><!----><!----></div><!----></div></div></section><!----><!----><!----><div data-v-2a6f6ec0="" data-v-25b273c2="" class="image-viewer-box"><!----></div></div><!----></div>
      
      
      <script type="text/javascript" src="./2.JS 基础知识点及常考面试题（一）_files/runtime.24cd77f11899da1ef6dd.js"></script><script type="text/javascript" src="./2.JS 基础知识点及常考面试题（一）_files/0.2c5447c62a349d40ad0f.js"></script><script type="text/javascript" src="./2.JS 基础知识点及常考面试题（一）_files/1.8a1ec2e286c0cc0327eb.js"></script>
    </body></html>